Created
April 26, 2020 09:57
-
-
Save nk-gears/7ca6d695b1c1b9b3dcfa76954f2a0be8 to your computer and use it in GitHub Desktop.
Start & End the Live (Go Live & End Stream)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function updateTransition(transitionState){ | |
YouTube.setTokenService(function(){ return getYouTubeService().getAccessToken(); }); | |
var resp=YouTube.liveBroadcastsList("snippet,status", {id:videoId}); | |
return YouTube.liveBroadcastsTransition(transitionState, videoId, "status", {}); | |
} | |
function startLive(videoId){ | |
const transitionState="live"; | |
updateTransition(transitionState); | |
} | |
function endLive(videoId){ | |
const transitionState="completed"; | |
updateTransition(transitionState); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment