Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

createVideoPlayer

My structure goes:

app.js
\__main.js
   \___video.js

This is my video.js

var win         = Titanium.UI.currentWindow;
var video        = win.video;

var activeMovie = Titanium.Media.createVideoPlayer({
    contentURL: video,
    backgroundColor:'#ff00ff',
    fullscreen:true,
    movieControlMode:Titanium.Media.VIDEO_CONTROL_FULLSCREEN,
    scalingMode:Titanium.Media.VIDEO_SCALING_MODE_FILL
});

activeMovie.addEventListener('complete',function(e)
{
    win.orientationModes = [Titanium.UI.PORTRAIT];
    win.close();
    Ti.App.fireEvent("finishMovie");
});

win.orientationModes = [
    Titanium.UI.LANDSCAPE_LEFT,
    Titanium.UI.LANDSCAPE_RIGHT
];

activeMovie.play();

When I open video.js, it appears as if my movie is playing behind everything as I can hear it and also, I can see it playing where the status bar is. How do I bring the video object to the foreground?

— asked October 27th 2010 by Ronnie Swietek
  • createvideoplayer
0 Comments

2 Answers

  • Looks like you forgot to add it to the current window: win.add(activeMovie);

    — answered October 27th 2010 by John Welch
    permalink
    0 Comments
  • Hey John. You are right. That was a retarded mistake. I am running into another issue now. When I hit the 'Done' button. The screen goes black and I get this in the console:

    [ERROR] Trying to constraint a view without a proxy's layout.
    [ERROR] Trying to constraint a view without a proxy's layout.
    
    — answered October 27th 2010 by Ronnie Swietek
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.