silvermine / videojs-chromecast

MIT License
148 stars 75 forks source link

Seeking video location is not working #32

Closed AndrewStobie closed 5 years ago

AndrewStobie commented 5 years ago

When I go to seek from the video on the computer that is casting to a television it does not allow for an update of the position in the video. It just stays in the video version.

I am using latest version of this plugin and video.js 7.2.2

I can not be certain but I feel this was working at some point in time.

yokuze commented 5 years ago

@AndrewStobie Thank you for the report. Is it possible for you to provide a minimal, complete, verifiable example? We haven't seen this issue in our own testing, so an MCVE will help us to pinpoint the issue.

Additionally, are you seeing the problem while seeking using the scrubber bar or are you seeking programmatically?

Guizzu commented 5 years ago

I'm also having this problem. The output in the console shows the following:

vendors.pages_video__id.js:34620 Uncaught (in promise) TypeError: Cannot read property 'buffered' of null at Html5.(anonymous function) [as buffered] (http://localhost:8080/_nuxt/vendors.pages_video__id.js:34620:20) at MasterPlaylistController.setCurrentTime (vendors.pages_video__id.js:56600) at HlsHandler.setCurrentTime (vendors.pages_video__id.js:58248) at Object.play (vendors.pages_video__id.js:57631) at executeRight (vendors.pages_video__id.js:24924) at mediate (vendors.pages_video__id.js:24867) at Player.techGet_ (vendors.pages_video__id.js:36833) at Player.play_ (vendors.pages_video__id.js:36924) at vendors.pages_video__id.js:36879 at new Promise (<anonymous>)

jthomerson commented 5 years ago

@Guizzoni same thing applies for you. We can't reproduce errors until we have more information. Please see the comment from @yokuze and follow through on that so that we're able to provide assistance. Until we get more info, I'm closing the ticket. Thanks!

Guizzu commented 5 years ago

@jthomerson Sorry about the lack of information, i've made a codesandbox example to show you the problem that is happening. https://codesandbox.io/s/1rx0wqwy9q

The sandbox above is only running nuxt, video.js and videojs-chromecast. Should i open another issue to deal with the problem?

jthomerson commented 5 years ago

Thank you for providing that. @yokuze can you take a look?

yokuze commented 5 years ago

@Guizzoni thank you for the reduced test case, that helped a lot. I discovered that there are actually two issues:

  1. The error you pasted, Uncaught (in promise) TypeError: Cannot read property 'buffered' of null at Html5.(anonymous function) [as buffered]: This is actually caused by a bug in the @videojs/http-streaming project that's used in Video.js. The bug was introduced in Video.js version 7.2.4 and was fixed in 7.4.1. (See this PR for http-streaming and this PR for Video.js). Once you update to 7.4.1, that particular error should stop, as demonstrated here: https://codesandbox.io/s/2pr872v2m0 (this is a fork of the example you provided)
  2. ChromecastTech does not implement the seekable method. The new error that you see in the CodeSandbox I linked to in the previous bullet point is caused by the Video.js player calling the seekable function, which delegates to the underlying Tech's seekable function, which is not implemented. This is not on the list of required functions to implement when creating a Tech but apparently it is required.

TLDR: Update to Video.js 7.4.1 and the error you see should go away, but you'll start seeing a different error. I can submit a PR to add the seekable function to the ChromecastTech, or we'd be happy to accept a PR that does that if you need it sooner rather than later.

Thanks

Guizzu commented 5 years ago

Thank you for the response @yokuze, updating to 7.4.1 really fixed the first issue, unfortunately the new error also happens in my project. I'd be happy to help implementing the seekable function but unfortunately i don't even know where to start.

stevendesu commented 5 years ago

Regarding the missing seekable method, this issue may also be resolved by my pull request (#43)

yokuze commented 5 years ago

@AndrewStobie @Guizzoni this issue should be fixed in version 1.1.2 of this plugin. Please let us know if you have any other issues.

@jthomerson this ticket can be closed.