iOS Tutorial VideoPlayer - Replaces VideoView

Status
Not open for further replies.
iUI8 library v1.50 includes a new VideoPlayer view. It replaces VideoView from iMedia library.

Apple has deprecated the API that VideoView was based on. VideoPlayer is based on the newer AVPlayerViewController.

It is implemented as a custom view. Using it is simple.

1. Add a reference to iUI8.
2. Set #MinVersion: 8
3. Add VideoPlayer with the designer.
4. Load a video.
5. Wait for the Ready event.
6. Optionally call Play to start playing automatically.

B4X:
Private Sub Application_Start (Nav As NavigationController)
   NavControl = Nav
   Page1.Initialize("Page1")
   Page1.RootPanel.LoadLayout("1")
   NavControl.ShowPage(Page1)
   VideoPlayer1.LoadVideo(File.DirAssets, "big_buck_bunny.mp4")
   Wait For VideoPlayer1_Ready (Success As Boolean)
   If Success Then
     VideoPlayer1.Play 'to start playing automatically
   End If
End Sub

Replace link in the attached example with: https://bestvpn.org/html5demos/assets/dizzy.mp4
 

Attachments

  • VideoPlayerExample.zip
    2.2 KB · Views: 1,301
Last edited:

Christian García S.

Active Member
Licensed User
Hello, thanks for the library.

I tested with B4i 5.00 and iUI8 and works fine, but I don't have sound, I do not know if this only happens with debug mode or also when I will publish the APP. I am using hosted builder and Iphone 6S plus.

I tested with my own video and with bunny and both doesn't have sound.

Thanks
 
Status
Not open for further replies.
Top