قالب وردپرس درنا توس
Home / IOS Development / ios – Display UI (storyboard possibly) with Broadcast UI Extension

ios – Display UI (storyboard possibly) with Broadcast UI Extension



I'm a little bit new to IOS programming, I'm trying to start a live broadcast using Replaykit, I've made some progress in calling the broadcast service pickup from the App, and also in making 2 add-ons (Broadcast Upload Extension and Broadcast UI -extension).
Apparently the extension of the UI extension should be loaded when the extension is selected from the picker view and the other receives data when the broadcast begins, I have tried in the first to create a view by creating a storyboard and giving it a custom class that is the same with that of the Broadcast UI extension, but when I click on the extension from the picker view, I get the immediate error The user denied the program recording (not sure if I'm missing a step here), get this same error without storyboard, I tried print () in overriding the func viewDidLoad () of the Broadcast UI expansion viewer and got no logs in the debugging area, so I didn't even see it being loaded at all.

What I need is to display simple user interfaces that will then call a Broadcast UI expansion view control feature ( func userDidFinishSetup () ) which then launches broadcast. I also accept if the broadcast can be started directly in the App without UI, in the Replaykit documents I saw a startBroadcast function I thought could achieve this, got a broadcastInvalidSession = -5808 error meaning that I "tried to start a broadcast without a previous session". Help greatly appreciated, thank you.

Broadcast UI view controller

  import ReplayKit

class BroadcastSetupViewController: UIViewController {
override func viewDidLoad () {
super.viewDidLoad ()
print ("Wassup?");
}

// Call this method when the user finishes interacting with the display controller and a broadcast stream can start
func userDidFinishSetup () {
print ("GET IN!");
// URL to the resource where broadcast can be displayed that will be returned to the program
let broadcastURL = URL (strictly: "http://apple.com/broadcast/streamID")

// Dictionary with setup information that will be given to broadcast the extension when broadcasting is started
la setupInfo: [String : NSCoding & NSObjectProtocol] = ["broadcastName": "example" as NSCoding & NSObjectProtocol]

// Tell ReplayKit that the extension has finished setting up and can begin broadcasting
self.extensionContext? .completeRequest (withBroadcast: broadcastURL!, setupInfo: setupInfo)
}

func userDidCancelSetup () {
leave error = NSError (domain: "YouAppDomain", code: -1
, userInfo: null) // Tell ReplayKit that the extension was canceled by the user self.extensionContext? .cancelRequest (withError: error) } }


Source link