Titanium Community Questions & Answer Archive

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

Need help with DONE on VideoPlayer

I want to add a "Done" button to an instance of

activeMovie = Titanium.Media.createVideoPlayer

that's embedded in a window. I can't seem to figure out how to get this button on the video player. All it has now are the controls: play/pause scrub. Thanks in advance!

— asked April 15th 2010 by Mark Smillie
  • videoplayer
0 Comments

5 Answers

  • var activeMovie = Titanium.Media.createVideoPlayer({
        url: media_url, //Ti.App.Properties.getString('hlsStream'),
        backgroundColor:'#111',
        movieControlMode:Titanium.Media.VIDEO_CONTROL_DEFAULT,
        scalingMode:Titanium.Media.VIDEO_SCALING_ASPECT_FILL,
        autoplay:true,
        fullscreen: true
    
    
    });
    

    I used the fullscreen set to true to get the 'done' but to show by default.

    — answered June 23rd 2011 by Edward Schopler
    permalink
    0 Comments
  • If you don't want the native player controls, use 'VIDEO_CONTROL_HIDDEN' when you create the videoPlayer. (or you can use VIDEO_CONTROL_NONE for iPhone 3.2+)

    then create a button (using createButton, or make on using createImageView) then use:

    activeMovie.add(yourButton);

    then create a listener for your button's click event to do things.

    though, the standard movie player should have its own 'done' button in the top left corner.

    — answered April 16th 2010 by Kosso
    permalink
    0 Comments
  • kosso, thanks.
    All of your answer works well. My question though, is about the actual "embedded video" on the screen. I have the activeMovie videoPlayer object in a window in a window (on an iPad). I'm using a button to start it and watch in a small window or the user can max it out to full screen. When i click the button I get the video player to open into the small window where it can play. BUT, there is no way to close it to go back to the button view from the small window. If I expand the player then I do get the "done" button…but I want it in the unexpanded view. Thoughts??? If not clear dm me on twitter @zinusm thanks.

    — answered April 16th 2010 by Mark Smillie
    permalink
    0 Comments
  • There seems to be an error in the documentation and the kitchen sink examples.
    the videoplayer object should have "mediaControlStyle" and deprecated "movieControlMode", but for Titanium.Media.VIDEO_CONTROL_FULLSCREEN it says: "Used in conjunction with movieControlStyle property of Titanium.Media.VideoPlayer in iPhone 3.2+"

    So the correct property to use in the videoplayer is "movieControlStyle", this works like expected.

    — answered November 28th 2011 by Susanne Klemme
    permalink
    0 Comments
  • This should help, just posted it.

    http://developer.appcelerator.com/question/135367/fullscreen-video-player-example-works

    — answered April 13th 2012 by Casey McLaughlin
    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.