I'm so sorry for asking such a basic question.
I've been struggling for a few days.
Because Google api documents are really the worst.
Here's how I am now.
With GoogleSignIn, OAuth is done. (It has information such as user ID, token, and API key...)
Success fetch playlist
func fetchPlaylist(id: String) {
let url = self.baseURL + "/playlists"
let params = ["part": "snippet", "id": id, "key": self.apiKey]
Alamofire.request(url, method: .get, parameters: params, encoding: URLEncoding.default, headers: nil).responseJSON { (response) in
if let response = response.result.value {
print(response)
} else {
print("error")
}
}
}
//////////// result
{
etag = "\"XI7nbFXulYBIpL0ayR_gDh3eu1k/ewwRz0VbTYpp2EGbOkvZ5M_1mbo\"";
items = (
);
kind = "youtube#playlistListResponse";
pageInfo = {
resultsPerPage = 5;
totalResults = 0;
};
}
- How to start Live Broadcast??
I think it's a stupid question.
But I'm really desperate.
https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/insert
According to this document, must specify a value for these properties.
- snippet.title
- snippet.scheduledStartTime
- status.privacyStatus
And also required parameters is part.
"The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
The part properties that you can include in the parameter value are id, snippet, contentDetails, and status."
But what the hell is this? cotentDetails?? status?? snippet?? I couldn't find this information anywhere in the document. I don't know what to do. Please help me.