I have been testing VideoView for the past hours and it works fine.
I have only one problem and one wish:
EDIT: problem resolved. I had to set NavigationBarVisible to false and that resolved my problem. I have adjusted my code below accordingly.
Problem (using LandscapeRight orientation)
-when the streaming starts, the video is not full screen. It seems that a part of the bottom is missing. However, when I tap on the bottom to enable the controls, then the video becomes full-screen. If I disable the controls, I cannot get the stream to go full screen. If I use the Page1_Resize(...) sub and change the videoview-size, then it is better but not full screen. Obviously I am doing something wrong here. Can someone help?
Here is the code:
For testing, myUrl4 is the best one although it requires more bandwidth.
Note: iMedia-library must be selected in the library-tab to run this example.
Wish:
-I have some problems with some streams. I think the MPMoviePlayerController class (which I believe you are wrapping) exposes two logs: accessLog and errorLog which could be useful for me to understand better what is happening. Any chance they can be added to the VideoView?
Thanks!
I have only one problem and one wish:
EDIT: problem resolved. I had to set NavigationBarVisible to false and that resolved my problem. I have adjusted my code below accordingly.
-when the streaming starts, the video is not full screen. It seems that a part of the bottom is missing. However, when I tap on the bottom to enable the controls, then the video becomes full-screen. If I disable the controls, I cannot get the stream to go full screen. If I use the Page1_Resize(...) sub and change the videoview-size, then it is better but not full screen. Obviously I am doing something wrong here. Can someone help?
Here is the code:
B4X:
'Code module
#Region Project Attributes
#ApplicationLabel: B4i videoview test
#Version: 1.0.0
'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
#iPhoneOrientations: LandscapeRight
#iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public NavControl As NavigationController
Private Page1 As Page
Private vv As VideoView
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.Color = Colors.White
vv.Initialize("vv")
Page1.RootPanel.AddView(vv.View,0,0dip,100%x,100%y)
'vv.ShowControls = False
Dim myurl As String = "http://a1408.g.akamai.net/5/1408/1388/2005110405/1a1a1ad948be278cff2d96046ad90768d848b41947aa1986/sample_mpeg4.mp4"
Dim myurl2 As String ="http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8"
Dim myurl3 As String = "http://192.168.1.5:8001/1:0:1:3:3DE:110:820000:0:0:0:"
Dim myurl4 As String = "http://www.playon.tv/online/iphone5/main.m3u8"
vv.LoadVideoUrl(myurl4)
NavControl.NavigationBarVisible = False 'permits fullscreen
'NavControl.ToolBarVisible = False ''permits fullscreen (maybe not needed)
NavControl.ShowPage(Page1)
End Sub
Sub vv_Ready
Log(vv.Duration)
vv.Play
End Sub
Sub vv_Complete
Log("stream finished")
End Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
' vv.View.Width = Width
' vv.View.Height = Height
End Sub
Private Sub Application_Active
End Sub
Private Sub Application_Inactive
End Sub
Private Sub Application_Background
End Sub
For testing, myUrl4 is the best one although it requires more bandwidth.
Note: iMedia-library must be selected in the library-tab to run this example.
Wish:
-I have some problems with some streams. I think the MPMoviePlayerController class (which I believe you are wrapping) exposes two logs: accessLog and errorLog which could be useful for me to understand better what is happening. Any chance they can be added to the VideoView?
Thanks!
Last edited: