Still trying to play a mp4 from my sdcard. Using MediaPlayerStream.
Here is the code
--------------
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim mp As MediaPlayerStream
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
mp.Initialize("mp")
End If
mp.Load("/mnt/sdcard/download/Para1a.mp4")
End Sub
Sub mp_StreamReady
Log("starts playing")
mp.Play
End Sub
Sub mp_StreamError (ErrorCode As String, ExtraData As Int)
Log("Error: " & ErrorCode & ", " & ExtraData)
ToastMessageShow("Error: " & ErrorCode & ", " & ExtraData, True)
End Sub
Sub mp_StreamBuffer(Percentage As Int)
Log(Percentage)
End Sub
---------------------------------------------
All I get is the sound. Thus it is finding the file.
Doing it on a Droid 2.
I did try videoview, but it says "cannot play the file"
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.DirRootExternal, "somefile.mp4")
vv.Play
End Sub
Sub vv_Complete
Log("Playing completed")
End Sub
-----------------------
It does not work on my Droid 2.
I have put the file in several locations will no success.
Mikie
As you can see the first code plays the sound, so it is finding the file. Why an I getting "cannot play the file" with VideoView. Could you e-mail me the source alone with the mp4 file. Did you do it in the emulator?
Thanx
VideoView is a thin wrapper above Android VideoView. The message is created by the native VideoView which is unable to decode your file. Try it with some other mp4 file.
I have tried several different mp4's sane result. When I tap on them in the phone they play. Do you have a simple(short) mp4 that plays? Email it to me.