I have built an App and it is working on Android but I am trying to play a local .MP4 or .M4V video file using Corona. I put the video file directly on device and it plays fine. I am using PAVTUBE and I have tried the H.264 and MPEG-4 formats per documentation…
It does not play using Corona code… please help:
function playMovie()
media.playVideo(“test.mp4”, true, onVideoComplete )
end
local onVideoComplete = function(event)
print( “video session ended” )
end
[import]uid: 10965 topic_id: 3608 reply_id: 303608[/import]
This is the feature of android itself. You can only play .mp4 videos if streamed from web or the file is in sd card. [import]uid: 48512 topic_id: 3608 reply_id: 30112[/import]
I have been testing the streaming video sample application and replaced the existing path with:
media.playVideo( “http://80.5.54.130/http2/apps/videos/mp4 rotated/warden.mp4”, media.RemoteSource, true )
If I play this file from the a memory stick or internal memory it runs okay.
If I point to this in the browser I get the error that I need a memory card to run the file.
When I run the sample app it simply says cannot play the format.
Local video (video files packaged in the APK) now plays on Android device builds with Corona SDK daily build 336 and later (developer.anscamobile.com/downloads/daily-builds). There is a remaining usability issue when returning/exiting from the video player back to your app (case 4523) that we hope to fix shortly.
Tim [import]uid: 8196 topic_id: 3608 reply_id: 30711[/import]
also one more thing when i try to play video on android it is left aligned with lots of space (black screen) in right in the iphones it is center aligned with equal black screen at both side how can i put that at center aligned for android and after completing video screen goes black completely even i am using timer to jump at next scene i figure if i lock device and unlock device again it is on next screen (not solution actually) works fine on idevices
the video is at the starting of game just to intro story
Tomorrow’s daily build (avilable to subscribers) contains several fixes for the Android video player. Particularly:
Now supports landscape view and change of orientation.
Automatically returns to the app when the video has ended.
Now supports the device’s back button to return to the app during playback.
Video is now centered horizontally onscreen instead of left justified.
It isn’t quite perfect just yet. It still has the following issues that we need to work on:
The video player’s controls cannot be hidden.
Video playback resets when changing the orientation of the device.
Ability to lock the orientation to landscape or portrait?
That said, this is a big improvement and we wanted to make sure to get it in your hands. And yes, we’re listening. [import]uid: 32256 topic_id: 3608 reply_id: 45565[/import]
Hmmm… our main server did not produce a daily build. I’ll have to check the server room and make sure that the hamsters are still running on their wheels. [import]uid: 32256 topic_id: 3608 reply_id: 45652[/import]
See the sample app “media/StreamingVideo” that is included with the Corona SDK to see how to stream video from the Internet. Alternatively, you can play a local video file that is included with your app and play it as follows…
I just want to verify that this is for the latest Corona SDK that fixes the Android video playback problems regarding the back button and returning to the previous screen after the video plays? [import]uid: 8780 topic_id: 3608 reply_id: 48403[/import]
Yes! There have been many video player fixes on Android in this release. The video player now automatically closes when the video finishes. You can also press the Android back button to exit the video player. Only a couple issues remain such as video playback resets when changing the orientation of the device. See my post up above (#10) for more details. [import]uid: 32256 topic_id: 3608 reply_id: 48410[/import]
We haven’t addressed these issues yet, but they are on our wish list.
Regarding locking the video player’s orientation, as a simple fix, how would you like it if we have the video player’s orientation match the orientation of your Corona app? That would be a simple fix to make; at least starting off. For example, if your app is landscape only, then the video player will be landscape. If your app is portrait, then the video player will be portrait. [import]uid: 32256 topic_id: 3608 reply_id: 56955[/import]
That would be a perfect fix for the projects i’m working on right now.
It would be so great if you could do that!!! [import]uid: 13632 topic_id: 3608 reply_id: 56965[/import]