Android Question Play URL Video

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
High everyone;
What is the code that plays a remote url video in the device stock video player ?
PhoneIntents.PlayVideo is good for local video file, but how to play remote streaming video without saving it?
 
Using Audio library
Code:
    Dim v As VideoView
    v.Initialize("vv")

    Activity.AddView(v,0,0,100%x,100%y)
    v.LoadVideo( "http","http://yourlinktovideofile")
    v.Play
 
Upvote 0
but it gives me message says (you have to install vitamio plugin to play this video and i need it to be played directly
 
Upvote 0
You're probably using the old and deprecated vitamio-wrapper which indeed required an "extra" install.
Unless you have codec-problems, try to use VideoVideo included in the standard Audio-library.
 
Upvote 0
Hi
I use this code successfully :

Code:
Sub playVideo(vid As String)
  
   Dim In As Intent
   In.Initialize(In.ACTION_VIEW,vid)
   In.SetType("video/*")
   If In.IsInitialized Then StartActivity(In)
   StartActivity(In)
  
End Sub

Then call it as:
Code:
playVideo("url address of video file")

It is great; but i want it to play the video directly inside the android stock video player ...
 
Upvote 0
Unsure if you want to use an external player or use a videoview embedded in your app??

If you want to use videoview embedded in your app, then use the code suggested by @somed3v3loper in one of the earlier posts
Make sure to tick the audio-library in the library pane on th right in the ide.
 
Upvote 0
Hi all, I'm trying to play a video from a url in the format: http://videa.hu/player?v=Aqy6ZFCwn4EADpPH.
Here's my code on Activity_Create:
Code:
Dim vi as VideoView
vi.initialize("vi")
Activity.AddView(vi,0,0,100%x,200dip)
vi.LoadVideo("http","http://videa.hu/player?v=Aqy6ZFCwn4EADpPH")

After running this piece, I get a dialog sayinh "Can't play this video".
I've verified the video link is active.

Thanks in advance.
 
Upvote 0
Then probably the video-codec in use is not supported natively by Android.
You can probably resolve by using one of the alternative VideoView wrappers available here in the forum (Search for Vitamio5, vlcb4a, FFmpeg_b4a)
 
Upvote 0
Back
Top