Plays the video at the specified path (both local and remote) in a device-specific popup Video media player.
During video playback, the media player interface takes over. If showControls is true, then the user can adjust playback, e.g. start, stop, seek, etc. Pass a listener to get notified when the video has ended. Note this function is asynchronous: any code that follows will be executed. After that, the application code will continue to run on iOS devices, but on Android devices the application will be suspended until the video playback is complete.
Supported video formats are platform- and version-dependent. The iPhone video player supports playback of movie files with the .mov, .mp4, .m4v, and .3gp filename extensions and using the following compression standards:
media.playVideo( path [, baseSource ], showControls, listener )
local onComplete = function(event) print( "video session ended" ) end media.playVideo( "Movie.m4v", true, onComplete )
path
The local filename or a remote URL for the video.
baseSource
Optional parameter that controls how the local filename path is interpreted. It can either be one of the system-defined directory constants, or media.RemoteSource (use this to access video on a remote server).
showControls
If true, then the user can adjust playback, e.g. start, stop, seek, etc.
listener
Listener to notify when the video has ended. The listener can be either a function listener or a table listener. If listener is a table, it must have a completion method. The event dispatched to the listener will be a completion event.
Nothing.
This API is not available in Corona Simulator.
I ran with this a .m4v file i created in iMovie, but the simulator just flashes up the Corona logo thing then goes blank.
I'm new to Corona and am getting frustrated that I can't even get a simple thing to work!!
Grateful for any help.
Video playback is currently only supported in device builds, not in Corona Simulator.
Is it possible (or planned) to play a youtube vid through media.playVideo? Something like
media.playVideo( "http://m.youtube.com/#/watch?xl=xl_blazer&v=NEjq0VwGrNc", media.RemoteSource, true )
I am trying to make an custom interactive video app.
Following are my queries:
1.1) Is There a work around to put some invisible buttons on top of video when playing which responds to touch event?
1.2) Any work around to have other event listeners such as OnPause?
2) Can I can skin the standard video controls with custom images.
3) I guess this is more of a feature request. To be able to play portion of video. Eg. media.play("myvideo.mp4", "0:05", "1:05", true). It plays video from 5th second till 1 minute 5 seconds
Sorry about flooding questions in single post. =)
The current video play is pretty basic and doesn't have any options to do what you need.
I would suggest posting your feature enhancements on the Forum so others can read and comment. That is one way that we gauge what users want in the product.
Thanks,
Tom
Does this work with Android? What is the file format that the video would need to saved in? Does it need to be in the rez stated for it to work?
Ok there is a problem with Android with this code. On all devices I have experimented with this code makes the video play vertical in a super small window and not horizontal like it should be. How do I fix this?
I want to create a seamless transition between a still and video on the ipad, but currently the play video call clears the screen and shows black for like 1 second before playing. Is there a way to work around this?
Hey man..
Did you get anyway to play videos or trailers inside the application?
ty
If I build the streaming video example this works fine ...
1 | media.playVideo( "http://www.anscamobile.com/video/Corona-iPhone.m4v", media.RemoteSource, true ) |
I need to stream 30MB-50MB videos. Please help. Thanks!
Resolved. Needed MIME type added to the server. :/
How do I find the code documentation for cases?
Example below is only a summary and I've searched and searched and don't find the cases explained:
Fixed media.playVideo() to support landscape, back button, and to back out when video ends. (571) - cases 2374, 4523
Any help is appreciated.
Thanks,
Richard
I'm using the complete event to switch scenes using storyboards. I get this error: "CGImageDestinationAddImage image parameter is nil" on a scene change and I've read that it may be related to not cleaning up any event listeners properly. Is there a way to cleanup this listener? Like media.removeListeners? Thanks.
I'm playing m4a files from my server using media.playVideo(). It works and is the only way a can see to do audio streaming from the web, but the background of the player has a >>Q<< "quicktime" sort of watermark on it. Is there any way to get rid of the watermark, or display a custom image instead of the watermark? Maybe layer a display object over the video player?? (I need to try that.)
I'm using playVideo to access radio streams. The stream should be played even if you turn off the screen, but pressing on/off button turns off the stream. Can I prevent this? I can't do it.
Problem solved with webpopup.
Hi cflowers,
Was just wondering if you can help me out. I'm very new to this sdk and just wanted to get some guidelines on streaming videos.
Basically I wanted to stream videos posted in youtube.com and vimeo.com on my app. Any suggestion on doing this?
Thanks much,
Is it possible to show videos inside the applikation. Like an intro video or a trailer before the next level.
Thanks webfraggle