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!
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.
-
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.
-
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. -
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.
-
This should help, just posted it.
http://developer.appcelerator.com/question/135367/fullscreen-video-player-example-works