Help with Video Component


#1

Hello,

Is there a way for the video component class to have some sort of a “isThumbLoaded()” member function?

For reasons I can’t really get into, I have my video and audio playing separately. They are being synced with a background thread. Every time the difference between the video and audio is more than 0.1 seconds, the player readjusts the video to catch up to the audio stream. The issue though, comes when I try to scrub the stream. The audio obviously loads much faster and starts playing, but the video takes a little longer to load (for obvious reasons) causing the video to hang for a few seconds.

If there was a way to check if the thumb was loaded, I can stop the audio stream till then and start the audio and video stream again when the video is in place.
Any thoughts? Suggestions?


#2

You could poll VideoComponent::getPlayPosition() and pause the audio meanwhile (i.e. sending empty buffers or call stop, if you use an AudioTransportSource). While loading you should get constant results for getPlayPosition(), vs. when playback starts, it will be constantly ascending.

Maybe my project linked in this thread is an alternative…