问题
The docs are a little hard to parse here. I was wondering if there was any way to
- Stream YouTube live into an iOS app, without significant/any YouTube branding.
- Stream from an iOS device as a broadcast stream for YouTube live.
My initial Googling turned up mixed responses. I was hoping to see an example of this if it's possible, or save myself some time if it's not.
Suppose I have a person on ATT next to a person on Verizon streaming content, and I want to make both appear as a single uninterrupted stream switching back and forth. Does YouTube or a library do to anything to facilitate this?
回答1:
Streaming from an iOS device is no different than streaming from any other device. You would have to write an h264 encoder and RTMP packetizer, and send the video to your YouTube stream
object's ingestionAddress
. Outlining the details of the encoder beyond the above is too broad for Stack Overflow, but I highly recommend looking at the VideoCore iOS project.
As far as branding goes, the only way to play back YouTube content in an iOS app without breaking YouTube's terms of service is to play the video in a UIWebView
or YouTube's iOS player helper library (which is just a web view with some playback interfaces).
There is no way to completely remove YouTube branding from the IFrame player. However, there are branding options you can toggle using the modestBranding
flag on the player. See the IFrame docs here.
来源:https://stackoverflow.com/questions/32418343/youtube-live-on-ios