Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- if(Ti.App.Properties.getString('device') == 'android') {
- exports.player = Ti.UI.createWindow();
- } else {
- exports.player = Ti.UI.createView();
- }
- var contentURL = 'http://movies.apple.com/media/us/ipad/2010/tours/apple-ipad-video-us-20100127_r848-9cie.mov';
- if(Ti.Platform.name == 'android') {
- //contentURL = "http://c0222252.cdn.cloudfiles.rackspacecloud.com/0032_MotoBlur.m4v";
- }
- exports.getstate = function() {
- return activeMovie.getPlaybackState();
- };
- var activeMovie = Titanium.Media.createVideoPlayer({
- contentURL : contentURL,
- backgroundColor : '#111',
- movieControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,
- //scalingMode : Titanium.Media.VIDEO_SCALING_MODE_FILL,
- scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT,
- autoplay : false
- });
- if(parseFloat(Titanium.Platform.version) >= 3.2) {
- exports.player.add(activeMovie);
- }
- exports.player.add(activeMovie);
- exports.playvideo = function(url) {
- activeMovie.stop();
- activeMovie.url = url;
- activeMovie.play();
- };
- exports.setfullscreen = function(bValue) {
- if(Ti.App.Properties.getString('device') !== 'android') {
- activeMovie.setFullscreen(bValue);
- }
- };
- } catch(ex) {
- functions.logError(ex);
- }
- activeMovie.play();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement