Hello ppl. Big thanks in advance.
I've created a custom musicplayer with createVideoPlayer and a slider to work together: Slider moves while the music plays. It does. Now I want to be able to forward and rewind with the slider. It doesn't work, I guess it is because it is a remote streaming/buffering mp3. But since the native player that comes with the videoPlayer works like that I thought I would be able to use the API and functions within it, but no.
Any suggestions? I've tried it with different setups as shown below:
slider.addEventListener('touchstart', function(e) { audioPlayer.pause(); }); slider.addEventListener('touchend', function(e) { videoPlayer.stop(); videoPlayer.setInitialPlaybackTime = slider.value;// I've tried initialPlaybackTime and some other stuff aswell videoPlayer.play(); });
1 Answer
Accepted Answer
Near the bottom of your {sdk_version}/iphone/classes/TiMediaVideoPlayerProxy.m file add:
-(void)setCurrentPlaybackTime:(id)value { movie.currentPlaybackTime=[TiUtils doubleValue:value]; }We hack this into every SDK release here to allow scrubbing. Couple of notes. If the stream is an MP3, then the scrubbing is very nice. If the stream is an m3u8, you move forward or back at the time increments set by the HLS segment size.
Your Answer
Think you can help? Login to answer this question!