dunski Member Licensed User Longtime User Sep 10, 2012 #1 When I try to use videoview with the folowing code I get this error message "Cannot play video", "Sorry, this video cannot be played" Code: Copy Dim vv As VideoView vv.Initialize("vv") Activity.AddView(vv, 0, 0, 100%x, 100%y) vv.LoadVideo("http","http://youtu.be/-FFlpxn-Twc") vv.Play I can play this youtube video on my phone no problem if I click on it from the browser. I also have the following in my manifest editor... AddPermission(android.permission.INTERNET) :sign0163: Last edited: Sep 10, 2012
When I try to use videoview with the folowing code I get this error message "Cannot play video", "Sorry, this video cannot be played" Code: Copy Dim vv As VideoView vv.Initialize("vv") Activity.AddView(vv, 0, 0, 100%x, 100%y) vv.LoadVideo("http","http://youtu.be/-FFlpxn-Twc") vv.Play I can play this youtube video on my phone no problem if I click on it from the browser. I also have the following in my manifest editor... AddPermission(android.permission.INTERNET) :sign0163:
dunski Member Licensed User Longtime User Sep 10, 2012 #2 Problem Solved Just in case this is ever of use to anyone.... I found that if you want to play a video from youtube you need to download it using a youtube downloader. Then convert it from .flv to .3gp using guess what... some converter. You can get lots off the net. Then upload the file to your own server which is what I did. I presume it would work on the sd card just as good also as long as its a .3gp. One last thing do not have any spaces in the URL name. example: "http://myserver.com/my file.3gp" This will not work. Make sure it is "http://myserver.com/myfile.3gp" Dunski Upvote 0
Problem Solved Just in case this is ever of use to anyone.... I found that if you want to play a video from youtube you need to download it using a youtube downloader. Then convert it from .flv to .3gp using guess what... some converter. You can get lots off the net. Then upload the file to your own server which is what I did. I presume it would work on the sd card just as good also as long as its a .3gp. One last thing do not have any spaces in the URL name. example: "http://myserver.com/my file.3gp" This will not work. Make sure it is "http://myserver.com/myfile.3gp" Dunski
B BowTieNeck Member Licensed User Longtime User Nov 13, 2012 #3 Sorry, this video cannot be played I'm also having trouble with VideoView. I'm trying to view a locally stored video file that gets copied from the assets folder to external (or internal if there's not enough space). The file started out as a .mov. I've tried converting it to wmv, mp4, 3gp and they all get rejected with the above message. They all play ok in Media Monkey, QuickTime or Windows Media Player. So it must be my code. I've added the 2 second wait between load and play as was suggested elsewhere, to no avail. I've attached a stripped down version of my app to illustrate the problem, hoping that someone can tell me where I'm going wrong. Thanks in advance. Upvote 0
Sorry, this video cannot be played I'm also having trouble with VideoView. I'm trying to view a locally stored video file that gets copied from the assets folder to external (or internal if there's not enough space). The file started out as a .mov. I've tried converting it to wmv, mp4, 3gp and they all get rejected with the above message. They all play ok in Media Monkey, QuickTime or Windows Media Player. So it must be my code. I've added the 2 second wait between load and play as was suggested elsewhere, to no avail. I've attached a stripped down version of my app to illustrate the problem, hoping that someone can tell me where I'm going wrong. Thanks in advance.
Erel B4X founder Staff member Licensed User Longtime User Nov 13, 2012 #4 Works fine here. VideoView can only play files from the external storage. I've changed this code: Code: Copy Sub CopyFileFromAssets (FileName As String) As String Dim TargetDir As String = File.DirRootExternal If File.Exists(TargetDir, FileName) = False Then File.Copy(File.DirAssets, FileName, TargetDir, FileName) End If Return TargetDir End Sub Upvote 0
Works fine here. VideoView can only play files from the external storage. I've changed this code: Code: Copy Sub CopyFileFromAssets (FileName As String) As String Dim TargetDir As String = File.DirRootExternal If File.Exists(TargetDir, FileName) = False Then File.Copy(File.DirAssets, FileName, TargetDir, FileName) End If Return TargetDir End Sub
B BowTieNeck Member Licensed User Longtime User Nov 13, 2012 #5 I didn't realise the file had to go in the External folder. I put it into the Internal folder because the SD card had filled up. I've now made some space. Thanks. Upvote 0
I didn't realise the file had to go in the External folder. I put it into the Internal folder because the SD card had filled up. I've now made some space. Thanks.
Erel B4X founder Staff member Licensed User Longtime User Apr 6, 2013 #6 The problem is that the message is displayed by the "native" VideoView class. I don't think that there is a way to dismiss it automatically. Upvote 0
The problem is that the message is displayed by the "native" VideoView class. I don't think that there is a way to dismiss it automatically.