Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3780

Keep PlayBackControls of MobileMoviePlayer visible

$
0
0

Hi,

I use a MobileMoviePlayer in an iOS App to play an audiobook and by default iOS hides the playback controls. They become visible as soon as the user taps into the playback area (where the video would be visible if it were a video) and hides them after a few seconds.

I found that there is

AVPlayerViewController.showsPlaybackControls as Boolean

in AVFoundation. Not sure if this would help but I wanted to give it a try.

I am trying to access the AVPlayerViewController using declares:

// Declarations to access AVPlayerViewController
Declare Function NSClassFromString Lib "Foundation" (clsName As CFStringRef) As ptr
Declare Function isKindOfClass Lib "UIKit" Selector "isKindOfClass:" (obj_id As ptr, cls As ptr) As Boolean
Declare Function nextResponder Lib "UIKit" Selector "nextResponder" (obj As ptr) As ptr

// Access AVPlayerViewController from the Xojo MoviePlayer
Var AVPlayerViewController As ptr = nextResponder(MediaMoviePlayer.Handle)

If isKindOfClass(AVPlayerViewController, NSClassFromString("AVPlayerViewController")) Then
  
  // Show playback controls
  Declare Sub setShowsPlaybackControls Lib "AVKit" Selector "setShowsPlaybackControls:" (obj As ptr, yesNo As Boolean)
  setShowsPlaybackControls(AVPlayerViewController, True)
  
End If

No error occurs but also nothing happens. Maybe I am looking for the wrong thing?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 3780

Trending Articles