vishen / go-chromecast

cli for Google Chromecast, Home devices and Cast Groups
Apache License 2.0
834 stars 80 forks source link

seek and seek-to reset media back to #80

Open mewtlu opened 3 years ago

mewtlu commented 3 years ago

Hey there! I've just downloaded go-chromecast via go get for the first time on a new device running Ubuntu 20 (having used it before successfully on a Mac) and I successfully managed to stream a local video to my Chromecast, but it appears any usage of seek, seek-to, or attempting to seek using the left/right arrow keys in the ui command interface, simply resets the video back to the start every time.

I've attached the logs below from running the seek-to command with --debug on and from what I can see there's nothing unexpected, and the final log appears to imply the seek was successful. Any assistance would be appreciated!

using device name=Living Room TV addr=192.168.86.22 port=8009 uuid=65cfe430cbb58bf41cf867184fe46bb1
DEBU[0000] (1)sender-0 -> receiver-0 [urn:x-cast:com.google.cast.tp.connection]: {"type":"CONNECT","requestId":1}  package=cast
DEBU[0000] (2)sender-0 -> receiver-0 [urn:x-cast:com.google.cast.receiver]: {"type":"GET_STATUS","requestId":2}  package=cast
DEBU[0000] (2)sender-0 <- receiver-0 [urn:x-cast:com.google.cast.receiver]: {"requestId":2,"status":{"applications":[{"appId":"CC1AD845","displayName":"Default Media Receiver","iconUrl":"","isIdleScreen":false,"launchedF romCloud":false,"namespaces":[{"name":"urn:x-cast:com.google.cast.cac"},{"name":"urn:x-cast:com.google.cast.debugoverlay"},{"name":"urn:x-cast:com.google.cast.broadcast"},{"name":"urn:x-cast:com.google.cast.media"}],"sessionId":"63b96247-8ebb-474e-ad6a-d1a1cf34bd78","statusText":"Default Media Receiver","transportId":"63b96247-8ebb-474e-ad6a-d1a1cf34bd78","universalAppId":"CC1AD845"}],"userEq":{},"volume":{"controlType":"attenuation","level":0.7799999713897705,"muted":false,"stepInterval":0.05000000074505806}},"type":"RECEIVER_STATUS"}  package=cast
DEBU[0000] (3)sender-0 -> 63b96247-8ebb-474e-ad6a-d1a1cf34bd78 [urn:x-cast:com.google.cast.tp.connection]: {"type":"CONNECT","requestId":3}  package=cast
DEBU[0000] (4)sender-0 -> 63b96247-8ebb-474e-ad6a-d1a1cf34bd78 [urn:x-cast:com.google.cast.media]: {"type":"GET_STATUS","requestId":4}  package=cast
DEBU[0000] (4)sender-0 <- 63b96247-8ebb-474e-ad6a-d1a1cf34bd78 [urn:x-cast:com.google.cast.media]: {"type":"MEDIA_STATUS","status":[{"mediaSessionId":5,"playbackRate":1,"playerState":"PLAYING","currentTime":42.072977,"supportedMediaCommands":274447,"volume":{"level":1,"muted":false},"activeTrackIds":[],"media":{"contentId":"http://192.168.86.21:41457?media_file=/home/luke/Downloads/video.mkv&live_streaming=true","contentType":"video/mp4","streamType":"BUFFERED","duration":5.130125,"metadata":{"MetadataType":0,"artist":"","title":"","subtitle":"","releaseDate":""},"mediaCategory":"VIDEO","tracks":[{"trackId":1,"type":"VIDEO"}],"breakClips":[],"breaks":[]},"queueData":{"startIndex":0},"currentItemId":1,"items":[{"itemId":1,"media":{"contentId":"http://192.168.86.21:41457?media_file=/home/luke/Downloads/video.mkv&live_streaming=true","contentType":"video/mp4","streamType":"BUFFERED","duration":5.130125,"metadata":{"MetadataType":0,"artist":"","title":"","subtitle":"","releaseDate":""},"mediaCategory":"VIDEO"},"autoplay":true,"orderId":0}],"repeatMode":"REPEAT_OFF"}],"requestId":4}  package=cast
DEBU[0000] (5)sender-0 -> 63b96247-8ebb-474e-ad6a-d1a1cf34bd78 [urn:x-cast:com.google.cast.media]: {"type":"SEEK","requestId":5,"mediaSessionId":5,"currentTime":130,"resumeState":"PLAYBACK_START"}  package=cast
vishen commented 3 years ago

Hello! Ah that's annoying, thank you for the logs they are very helpful. This may be an issue with the default receiver itself, or an issue with how we seek. For the "Default Media Receiver" and "Plex" cast-applications we always try and seek-to (regardless of if it is a seek) since I believe when transcoding it isn't able to seek.

Let me do some investigation on this, seeking may not be possible when transcoding unfortunately but I'll play around with it.