broadcast: Invalid transition error when stopping a broadcast.

Issue #235 resolved
Trek Hopton created an issue

When a broadcast has been started but no video data is coming through, it’s often because the camera has not turned on. A common course of action is then to want to change configuration and try again. When the stop button is hit in order to stop the current broadcast, the error message shows: could not stop broadcast: complete broadcast error: googleapi: Error 403: Invalid transition, invalidTransition

I believe this should not be invalid since it should be possible to stop the broadcast in this case.

To recreate the error, start a broadcast without turning a camera on, then try to hit the stop button when the broadcast is waiting for the video stream.

The possible states seem to be (from youtube-gen.go line 5117 in go youtube API)

// Possible values: // "lifeCycleStatusUnspecified" - No value or the value is unknown. // "created" - Incomplete settings, but otherwise valid // "ready" - Complete settings // "testing" - Visible only to partner, may need special UI treatment // "live" - Viper is recording; this means the "clock" is running // "complete" - The broadcast is finished. // "revoked" - This broadcast was removed by admin action // "testStarting" - Transition into TESTING has been requested // "liveStarting" - Transition into LIVE has been requested

Our code tries to transition to complete in broadcast.go ln 1129.

It’s not clear to me after reading the docs why this is an invalid transition. https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/transition

What ends up happening is we create another broadcast and have to go to the YouTube studio page and manually delete the broadcast that is still waiting to be stopped.

Comments (2)

  1. Log in to comment