Unable to play mp4 with VideoView

metrick

Active Member
Licensed User
Longtime User
I have try several difference encode and size of the video from avi to difference format of MP4, using the codes below to play the video.
Always get message "Cannot play video Sorry, this video cannot be played"

I have also tried mp4 file taken from camera and still said that the video cannot be played.
Note: the video play file in the camera.

Any body has a working codes that can play mp4 file and would like to share would be very much appreciated.

Sorry, can't do stackoverflow yet, will take a look later



Sub Globals
Dim vv As VideoView
End Sub
Sub Activity_Create(FirstTime As Boolean)
vv.Initialize("vv")
Activity.AddView(vv, 10dip, 10dip, 250dip, 250dip)
vv.LoadVideo(File.DirInternal, "MyFile.mp4")
vv.Play
End Sub
Sub vv_Complete
Log("Playing completed")
End Sub
 

jruiz1998

Member
Licensed User
Longtime User
Something else..
Video from Azure Storage

I used:
vv.LoadVideo("/storage/extSdCard/", "videos_barcode_2/video1.mp4")
vv.Play
And worked very well.

When I changed to work with Azure Storage... Did not work.
vv.LoadVideo("http", "http://appl.blob.core.windows.net/videos/video1.mp4")
vv.Play

It display nothing, only a black screen, does nothing
I checked with
If vv.IsPlaying = True Then --- and goes to FALSE



I added "<uses-permission android:name="android.permission.INTERNET"/>" to Manifest Editor (AddManifestText).
I used the URL directly from browser and worked fine.

¿What is it wrong?

Thanks
Jorge
 
Upvote 0

jruiz1998

Member
Licensed User
Longtime User
Thanks for you replay.
Yes, I checked using chrome and IE. It worked fine.

Note:
The URL I wrote is not the correct, I change the Application Name and the filename

Thanks
Jorge
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Maybe you need to set
AddPermission(android.permission.ACCESS_NETWORK_STATE) ' Allows applications to access information about networks.
in your manifest too
 
Upvote 0

jruiz1998

Member
Licensed User
Longtime User
Thanks ..
I added the permission for Access_Network_State... the problem continues.
I noticed that if I use Chrome or IE from Windows, works fine. But if I use Chrome or standard browser from Android Smartphone or Tablet, it does not work.
Maybe the problem is at Azure Storage metadata.
The only change I have made at Azure Storage metadata is the Content Type to "videos/mp4" .
I am still looking for the answer-
If you have some tips, let me know.
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
That means the site doesn't allow mobile devices to access the site.

Maybe or maybe not :)

It may be a codec-issue i.e. a codec (used in the MP4-container) that is not supported natively by Android and thus it won't work neither with VideoView nor Android-browsers. You could install VLC-player and paste the link within the app and see if streaming starts. If it does, then you will probably need a VideoView which supports FFMPEG. You can search for these here in the forum (Vitamio or FFMpeg-library).
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
On seconds thoughts (only after reading the thread properly), NJDude is probably right since the video-file worked fine locally (presuming the file is the same one).....
 
Upvote 0

jruiz1998

Member
Licensed User
Longtime User
SOLVED...
I changed the Bitrate from 2216 Kbps to 797 Kbps and also the Size from 1280x720 to 720x576.
I used a video converter utility.

Thanks to everybody for your comments.

Jorge
 
Upvote 0
Top