Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

YouTube live api transition request count error

$
0
0

I'm using YouTube API v3 for a live streaming application that I'm developing. I follow these steps in order.

  • I create a broadcast with the broadcast insert method
  • I create a livestream with the livestream insert method and then bind it to the broadcast.
  • I start broadcasting via rtmp
  • I change the broadcast status to "live" using transition method.
  • After finished the live stream, I call transition method to change live stream status to "completed".

I'm exactly sure that I only do every step only once for each live stream.

I do not have any problems with the operation of the flow described above. While the live broadcast is continuing, when I check the API quota and limits from the console about half an hour later, the number of requests for the transition method starts to exceed 1000s. And request error rate is around 98%. I don't understand exactly what's going on here. Because as I said before, I only call each method once on its turn. Why does the transition method, which I call only at the beginning and end of a live broadcast, seem to be called 1000s with an error rate of almost 99%? If anyone has information, please help.Due to this dramatic and non-sense increase, suddenly fills the daily quota of 10 thousand.

For each transition call, I think I should only see 1 call in the console logs. Or YouTube should explain why. Because I have not come across such information in any document. Below I've added my code that sets a livestream to "live" status. It is called only once the button is clicked.

The API request view for the last 6 hours is here

 try {                if (eventHandler != null) {                    activity.addUIAction(()->eventHandler.eventStarted(EventType.START_EVENT));                }                Log.i(TAG,"BroadcastId : "+broadcastId);                Transition transitionRequest = youTubeService.liveBroadcasts().transition("live", broadcastId, "status");                transitionRequest.execute();                if (eventHandler != null) {                    Log.i("YouTubeStartEvent","Started");                    if(eventHandler!=null)                        activity.addUIAction(()->eventHandler.eventFinishedWithSuccess(EventType.START_EVENT));                }            } catch (Exception e) {                if (eventHandler != null) {                    activity.addUIAction(()->eventHandler.eventFinishedWithException(EventType.START_EVENT, e));                }            }

Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>