記錄一下工作需要研究的youtube live streaming的呼叫
前置作業
要先到https://console.developers.google.com/ 要先開一個專案並申請api金鑰
帳號啟用直播功能
如果帳號未啟動直播功能,會噴以下錯誤
{
error = {
code = 403;
errors = (
{
domain = "youtube.liveBroadcast";
extendedHelp = "https://www.youtube.com/features";
message = "The user is not enabled for live streaming.";
reason = liveStreamingNotEnabled;
}
);
message = "The user is not enabled for live streaming.";
};
帳號啟用直播功能
如果帳號未啟動直播功能,會噴以下錯誤
{
youtube官方文件
https://support.google.com/youtube/answer/2853700?hl=en&ref_topic=6136989YouTube Live Streaming API Overviewhttps://developers.google.com/youtube/v3/live/getting-started
YouTube Live Streaming API Code Samples (JAVA/PHP/PYTHON)
Objective C libs for REST
https://developers.google.com/youtube/v3/code_samples/code_snippetsGithub上的api列表,有包含live streaming,但不含iOS sample
https://github.com/youtube/api-samples
Live encoder settings, bitrates, and resolutions
Encoder settings for Live 360 degree videos 如果要360直播要改一下encoder設定
https://support.google.com/youtube/answer/6396222
錯誤代碼
https://developers.google.com/youtube/v3/docs/errors
錯誤代碼
https://developers.google.com/youtube/v3/docs/errors
實作範例
android的live streaming source code
https://youtube.github.io/yt-watchme/
https://youtube.github.io/yt-watchme/
找到Swift的範例 for live streaming
使用 YouTube API 打造影音搜尋 App
http://www.appcoda.com.tw/youtube-api-ios-tutorial/
Google Oauth2 教學
http://technogerms.com/login-with-google-using-oauth-2-0-for-ios-xcode-objective-c/
Google API - YouTube Live Streaming API申請
Google Oauth2 教學
http://technogerms.com/login-with-google-using-oauth-2-0-for-ios-xcode-objective-c/
Google API - YouTube Live Streaming API申請
http://wwsleepzzz.blogspot.tw/2016/11/google-api-youtube-live-streaming-api.html
完整的data api v3的小型iOS應用程式
This application utilizes YouTube Data API v3, YouTube iFrame Player API, YouTube Resumable Uploads and OAuth2.https://github.com/youtube/yt-direct-lite-iOS
完整的data api v3的小型iOS應用程式
This application utilizes YouTube Data API v3, YouTube iFrame Player API, YouTube Resumable Uploads and OAuth2.https://github.com/youtube/yt-direct-lite-iOS
沒有留言:
張貼留言
留個話吧:)