Reputation: 295
I'm trying to use ReplayKit to live stream from within an iOS app on iOS 11 and Swift 4. My code succesfully live streams to MobCrush, but when I select YouTube and the broadcast is supposed to get kicked off it fails.
Relevant code:
func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController,
didFinishWith broadcastController: RPBroadcastController?,
error: Error?) {
//1
guard error == nil else {
print("Broadcast Activity Controller is not available.")
print("ERROR BROADCASTING: " + error!.localizedDescription)
return
}
//2
broadcastActivityViewController.dismiss(animated: true) {
//3
broadcastController?.startBroadcast { error in
//4
//TODO: Broadcast might take a few seconds to load up. I recommend that you add an activity indicator or something similar to show the user that it is loading.
//5
if error == nil {
print("Broadcast started successfully!")
self.broadcastStarted()
}
}
}
}
It Prints: Broadcast Activity Controller is not available.
ERROR BROADCASTING: The user declined application recording
Trying to figure out if this is an issue with YouTube or with some permissions/implementation problem on my side.
It's worth noting that ReplayKit streaming clearly does not work for some of the advertised platforms (e.g. Periscope), but I have successfully gotten YouTube ReplayKit to work with some other apps I tested, so it should be possible.
Upvotes: 3
Views: 839
Reputation: 3247
I'm seeing a similar thing.
MobCrush - Works beautifully
Periscope - Stream starts, connects & the entry shows-up in Periscope but the video is blank/inaccessable when you want to view it either live or saved.
Youtube - An error occurs, stopping streaming from starting, yet a Scheduled Livestream entry appears for the live stream you attempted to do. This is scheduled about 8 hours in the past for me. (But I'm sure this value depends on your system clock relative to the US West Coast)
So. It appears only MobCrush seems to have upheld its end of the bargain.
Upvotes: 0