It seems to be a scaling issue related either to the video or the specific device.
You can try scaling down the video.
I've read a post from someone who encountered the same issue and solved it by resizing the view shortly after the playback started. It is worth a try.
B4X:Sub Globals Dim vv As VideoView End Sub Sub ResizeVideo vv.Left=0 vv.Top=0 vv.Width=1024 'Set to desired size vv.Height=600 'Set to desired size End Sub
Sub Activity_Create(FirstTime As Boolean)
vv.Initialize("vv")
Activity.AddView( vv, 10dip, 10dip, 230dip, 180dip)
vv.LoadVideo(File.DirRootExternal, "mb.wmv")
vv.Play
ResizeVideo
End Sub
Sub ResizeVideo
vv.Left=10dip
vv.Top=10dip
vv.Width=230dip 'Set to desired size
vv.Height=180dip 'Set to desired size
End Sub
Sub Activity_Create(FirstTime As Boolean)
vv.Initialize("vv")
Activity.AddView( vv, 10dip, 10dip, 230dip, 180dip)
vv.LoadVideo(File.DirRootExternal, "mb.wmv")
vv.Play
ResizeVideo
End Sub
Sub ResizeVideo
Dim Tstart As Long
Tstart = DateTime.Now
Do While DateTime.Now-Tstart < (Tvar*1000)
Loop
vv.Left=10dip
vv.Top=10dip
vv.Width=230dip 'Set to desired size
vv.Height=180dip 'Set to desired size
vv.LoadVideo(File.DirRootExternal, "mb.wmv")
End Sub
Try this code. This is not the best way for a pause but it is good enough to try. This works fine on my device running Android 2.2. Let use know if this works.
B4X:Sub Activity_Create(FirstTime As Boolean) vv.Initialize("vv") Activity.AddView( vv, 10dip, 10dip, 230dip, 180dip) vv.LoadVideo(File.DirRootExternal, "mb.wmv") vv.Play ResizeVideo End Sub Sub ResizeVideo Dim Tstart As Long Tstart = DateTime.Now Do While DateTime.Now-Tstart < (Tvar*1000) Loop vv.Left=10dip vv.Top=10dip vv.Width=230dip 'Set to desired size vv.Height=180dip 'Set to desired size vv.LoadVideo(File.DirRootExternal, "mb.wmv") End Sub
Sub Button1_Click
Dim i As Int
vvv.LoadVideo(File.DirRootExternal, "mb.wmv")
For i = 1 To 30000
Next
vvv.Height =180dip
vvv.Width = 230dip
For i = 1 To 30000
Next
vvv.Play
End Sub
Sub Button2_Click
Dim i As Int
vvv.Height =180dip
vvv.Width = 230dip
vvv.LoadVideo(File.DirRootExternal, "mb.wmv")
For i = 1 To 30000
Next
vvv.Play
End Sub
Sub Button3_Click
Dim i As Int
vvv.LoadVideo(File.DirRootExternal, "mb.wmv")
vvv.Play
For i = 1 To 30000
Next
vvv.Height =180dip
vvv.Width = 230dip
End Sub
What device are you running this on? What version of Android is it running? Do you have a .MP4 file to try? The code I sent runs file on 2.2 but it was a .MP4 file. What SDK are you building the app under, API Level 8?
I've tested this file on Samsung Galaxy Nexus and both the default player and VideoView fail to play it at all.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?