Android Question VideoView LoadVideo http

rbirago

Active Member
Licensed User
Longtime User
No problem in opening local clips, so I tried to open an http clip following the rules explained in Audio library, but it doesn't work.
The trial is very simple:

B4X:
#Region  Project Attributes
    #ApplicationLabel: VideoView
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals

End Sub

Sub Globals

    Dim vv As VideoView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    vv.Initialize("vv")
    Activity.AddView(vv, 10dip, 10dip, 250dip, 250dip)
'    File.Copy(File.DirAssets, "test3.mp4", File.DirInternal, "MyFile.mp4")
'    vv.LoadVideo(File.DirInternal, "MyFile.mp4")
    vv.LoadVideo("http","http://127.0.0.1:51042/video/test3.mp4")
    vv.Play
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Sub vv_Complete
    Log("Playing completed")
End Sub

I have also implemented the manifest:

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="14"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")
'End of default text.
'AddPermission("android.permission.INTERNET")

trying a local LoadVideo all is ok and I've tried to play the http video using VLC and all is ok (the webserver runs properly)...so: where is my mistake?

thank you in advance

Roberto
 
Top