videojs-youtube updated source not updating duration - video.js

I've managed to hook up videojs with youtube using https://github.com/eXon/videojs-youtube. The problem I have is, after I update the source to a different youtube video, it sometimes doesn't update the duration of the player, so the duration bar doesn't work properly.
Any ideas how I can get the duration of the updated youtube video and update the duration on the player?
Thanks

Related

Vimeo Player SDK - 'playing' event firing prematurely?

I'm having an issue where I'm using Vimeo Player SDK in a project and I don't want the user to see the thumbnail before playback. I'm triggering playback via code and attempting to display the video once it actually starts playing. I'm listening to the 'playing' event and would expect it to only trigger, once the video is actually playing. But I'm still getting the thumbnail. Am I missing something here?
For clarity, I'm listening to the player.on('playing', ..) event, not player.on('play', ..)
Example: https://jsfiddle.net/avt_pj/hqgtram0/31/
Vimeo replied with this:
The playing event is fired by the <video> element itself, so
we don't control the timing of that in our player.
If it's critical to know the precise moment when the first frames of a
video are being played, I'd suggest wrapping this in a
setTimeout or listening to the timeupdate event.

In react-native-video, how do I reset the video player when the video has finished playing?

I have a react-native app with videos that I am displaying using react-native-video. Right now when the video has finished playing you have to manually drag the control for the position of the video back to zero and then press play to have the video restart.
How can I make the video automatically reset when it has been played to the end? (Or even better, is there any way to add a replay button?)
Currently the app is only for iOS.
Try adding repeat value equals to true in Video Component. It will do your work and video will autoplay upon ending.
<Video...repeat={true}/>

How to Get the Playable duration in react native video when the video is paused

I am using the react-native https://github.com/react-native-community/react-native-video library to play the videos in my mobile app.
Now I wanted to show the playable duration ( amount of video that is already loaded in the player) as you can see in the picture
To get the playable duration i am using the following method
onProgress={this.onProgress.bind(this)}
Problem here is that this method only triggers when the video is playing ,this method is not called when the video is paused
so my question is is there any way i can get the playable duration when the video is paused

stop all videos when a new video is played in react native

i want to stop all video when new video is playing. I am using react-native-video library to play video. If I play a video it starts playing, if I click on another video in the list it also starts playing, both videos are getting played at the same time
Keep an array of video play/pause state to ensure that only one can be true at a time. Then update the Video component paused property on update.

Event that fires when video is loaded and first frame is visible? Or how to crossfade two videos another way?

I am trying to use video.js in a samsung smart tv application which unfortunately can only play one video at a time.
I need to simulate the smooth, preferably crossfade, transition between two videos. I am trying to do this by first fading in a screenshot of the next video and using that to cover up the screen while I switch video sources of the video.js plugin. When the player is ready I need to remove the screenshot.
The closest I have found is to remove the screenshot when "loadedmetadata" is called however I am still seeing an inconsistant blip of a black flash between the time the screenshot is removed and the video plays. This is very jarring and I need a consistent way to remove the screenshot only when the first frame has been loaded into the player.
Any other suggestions on how I could each a smooth transition between two videos while only using one video element would be greatly appreciated.
I found the loadeddata event which, as described on MDN :
The loadeddata event is fired when the first frame of the media has finished loading.
loadedmetadata only announce that media informations such as duration are loaded, but the loadeddata event should do the trick.