Titanium Community Questions & Answer Archive

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

Video shows up behind window unless I add it

When I click my button to open a video, I am opening a window called videoWin via videoWin.open() which points to login.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();

The above code makes the movie show up behind my tabGroup. If I insert win.add(activeMovie), the video is on top, but then when I close it (hit the Done button), it just shows a black screen. I tried doing win.remove() but that didn't work. I've also tried setting the zIndex on the window, but no luck

— asked October 25th 2010 by Ronnie Swietek
  • video
  • zindex
0 Comments

1 Answer

  • can anyone tell me how to get my video on top of the screen without doing an

    win.add(activeMovie); ?

    According to the kitchen sink demo, the video object itself isn't added to the window anyway.

    — answered October 26th 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.