Quantcast
Viewing all articles
Browse latest Browse all 8068

SetCurrentPlaybackTime does nothing

I'm new to Titanium and I want to set the current time of a video at the push of a button. However the setCurrentPlaybackTime doesn't seem to do anything. The video plays okay, but it doesn't jump to 10 seconds like I intend it to. I'm on build 3.1.3.201309132423 and I test the application using the mobile web previewer. What am I doing wrong? Here is my code:

var vidWin = Titanium.UI.createWindow({
    title : 'Video',
    backgroundColor : '#fff'
});
 
 
var videoPlayer = Titanium.Media.createVideoPlayer({
    top : 2,
    autoplay : true,
    //backgroundColor : 'blue',
    height : 300,
    width : 300,
    mediaControlStyle :  Titanium.Media.VIDEO_CONTROL_NONE,
    scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT
});
 
videoPlayer.url = 'movie.mp4';
vidWin.add(videoPlayer);
vidWin.open();
 
 
var button = Titanium.UI.createButton({
   title: 'jump to 10s',
   top: 400,
   width: 100,
   height: 50
});
 
button.addEventListener('click',function(e)
{
   videoPlayer.stop();
   videoPlayer.setCurrentPlaybackTime(10);
   videoPlayer.play();
 
});
 
vidWin.add(button);

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>