Titanium Community Questions & Answer Archive

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

Movie done button issues

Hi there,

I see people are having issues with playing Movies in full screen mode and movie controls etc.. but anyone having issues with the 'Done' button? It's not closing my window view, it just pauses the movie. The only way I can get out of the movie is to watch the whole clip.

Code (using the KS remote example):

// dynamic url with dynamic encoding (from kosso)
var media_url = "http://www.domain.com/iphone/clips/showreel.mp4";
var win = Titanium.UI.currentWindow;

var activeMovie = Titanium.Media.createVideoPlayer({
    url:media_url,
    backgroundColor:'#111',
    movieControlMode:Titanium.Media.VIDEO_CONTROL_DEFAULT
});

if (parseFloat(Titanium.Platform.version) >= 3.2)
{
    win.add(activeMovie);
}

activeMovie.play();

activeMovie.addEventListener('complete',function()
{
    win.close();
});

win.addEventListener('close', function() {
    alert("Window closed");
    activeMovie.stop();
    win.close();
});

Any workarounds would be appreciated.

Many thanks

— asked August 2nd 2010 by Craig Jones
  • ios4
  • movie
0 Comments

2 Answers

  • Accepted Answer

    I have the same problem. Since I start movies in fullscreen mode and the done button switches to non-fullscreen mode, my workaround is to listen for that event instead:

    videoPlayer.addEventListener('fullscreen', function (e) {
        if (!e.entering) {
            videoPlayer.stop();
            videoPlayer.release();
            win.close();
        }
    });
    
    — answered August 2nd 2010 by Michael Descher
    permalink
    1 Comment
    • Thanks Michael, loading the video in full screen and with your code above worked a treat!

      — commented August 5th 2010 by Craig Jones
  • Hi Craig,

    Yes i did, and have reported the bug back in 1.3.x but still no progress. If you are having the issue, add your comment to the ticket below that you are experienced the same problem.

    Done button is not longer triggering anything where it suppose to, at least it used to and the api doc says it should.

    https://appcelerator.lighthouseapp.com/projects/32238/tickets/1373-ios-videoplayer-done-button-doesnt-trigger-any-eventlistener

    — answered August 2nd 2010 by Daniel Lim
    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.