Created
December 5, 2012 02:04
-
-
Save srahim/4211452 to your computer and use it in GitHub Desktop.
timob-11864
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win1 = Titanium.UI.createWindow({ | |
title:'Test', | |
backgroundColor:'#fff' | |
}); | |
var label = Ti.UI.createLabel({ | |
top: 30, | |
width:100, | |
height:30, | |
text: 'start video', | |
backgroundColor:'white' | |
}); | |
win1.add(label); | |
label.addEventListener('singletap', function(e){ | |
activeMovie = Titanium.Media.createVideoPlayer({ | |
width: 640/4, //if the aspect is not video default, then you'll get an exception | |
height: 360/4, //if the aspect is not video default, then you'll get an exception | |
fullscreen: true, //this one must be true, or the video must be resized for the exception | |
autoplay: false, | |
url: 'movie.mp4', | |
backgroundColor:'#000', | |
movieControlMode:Ti.Media.VIDEO_CONTROL_DEFAULT, | |
scalingMode:Ti.Media.VIDEO_SCALING_ASPECT_FIT | |
}); | |
win1.add(activeMovie); | |
activeMovie.addEventListener('complete', function(e){ | |
Ti.API.info('movie finished playing'); | |
if (activeMovie.playing == true) { | |
Ti.API.info('movie is playing'); | |
activeMovie.stop(); | |
} else { | |
Ti.API.info('movie is stopped'); | |
} | |
activeMovie.fullscreen = false; | |
win1.remove(activeMovie); | |
Ti.API.info('movie onComplete finished'); | |
}); | |
activeMovie.play(); | |
}); | |
label.addEventListener('doubletap', function(e){}); | |
win1.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment