Я новичок в API YouTube. Я создал и получил прямые трансляции на YouTube. Но я пытаюсь запустить живые события из своего приложения. Я получаю эту ошибку:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
POST https://www.googleapis.com/youtube/v3/liveBroadcasts/transition?broadcastStatus=live&id=m0BCwKmG9Ws&key=AIzaSyCRiIM7Tdb_rqFcGSbQ0jXy0GeODCNSq4g&part=status
{
"code": 403,
"errors": [
{
"domain": "youtube.liveBroadcast",
"message": "Stream is inactive",
"reason": "errorStreamInactive",
"extendedHelp": "https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/transition"
}
],
"message": "Stream is inactive"
}
Код для запуска
fun startEvent(youtube: YouTube, broadcastId: String?) {
val transitionRequest = youtube.liveBroadcasts().transition(
"live", broadcastId, "status"
)
transitionRequest.key = context.getString(R.string.api_key)
transitionRequest.execute()
}
Я также пробовал это, но все еще получаю ту же проблему. Я не знаю, что с ним не так?