Skip to content
This repository was archived by the owner on Apr 1, 2023. It is now read-only.

External Player#68

Merged
marioortizmanero merged 22 commits intomasterfrom
server
Mar 22, 2020
Merged

External Player#68
marioortizmanero merged 22 commits intomasterfrom
server

Conversation

@marioortizmanero
Copy link
Member

This closes #29. It's also progress towards #56.

The External Player is implemented the same way as VLC or Mpv. It required a couple changes to how the Player classes work, but it can still be used the same. Thus, --player external is needed to activate it. There's detailed information about how it can be set-up in the README.md.

It uses Network Service Discovery (zeroconf) so that clients can connect to the Vidify server, and then sends the video information continuously via JSON packets over TCP. The protocol is described inside vidify.player.external.

For now, only the server sends packets to the clients. In the future, the clients will need to send special packets to the server with necessary information about the device and such. That part is implemented but currently has no use.

Changes to the Player interface:

  • Now they can either take a YouTube link, or a direct link to the video, depending on what player.DIRECT_URL's value is. YouTubeDLWorker now returns a dict rather than the direct URL str. The URLs can be extracted with get_direct_url or get_youtube_url, later on.
  • player.position no longer has a setter. It's been renamed to seek, which supports both relative & absolute positions. This was necessary because some players like this one don't have access to their own position, and because some players like mpv have different methods for relative/absolute seeking, which may be more efficient.
  • The players are now correctly deleted when the app is closed. vidify.gui.window now has a closeEvent method that will de-initialize it. This is needed to close the server sockets and unregister the NSD service.
  • Players have undefined behavior when the video's properties are modified before a video plays.

This branch also includes a couple fixes for bugs I found while modifying the repo. One of them fixes a bug where if no songs are playing on the Spotify Web API, it would crash (because metadata.item is null). Another one fixes the Player custom attributes, which were terribly implemented and didn't work.

@marioortizmanero marioortizmanero merged commit 229d8cb into master Mar 22, 2020
@marioortizmanero marioortizmanero deleted the server branch March 22, 2020 14:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Online/Local bridge to send Spotify data between devices

1 participant