For the last year I have been using a PHP script to build a playlist from a small collection of videos. It would build a custom playlist of the selected videos and render a set of playlist controls from the API. As of this time yesterday it was working, now it is not.
Here's the snippet that is broken:
$result = "<iframe width=\"720\" height=\"405\" src=\"https://www.youtube.com/embed/?playlist=";
$last = count($playlist) -1;
for ($k=0; $k < count($playlist); $k++){
if ($k < $last){
$result = $result . $playlist[$k]['videoid'] . ",";
} else {
$result = $result . $playlist[$k]['videoid'] . "&controls=1\" frameborder=\"0\" allowfullscreen></iframe>";
}
I get the following error instead of an imbed with a list of playback selections:
An error occurred. Please try again later. (Playback ID: jBLBkfJOl8-X0sct)
Has something changed in the API on Aug 31, 2020? I am not finding any documentation or information that is specifically about building custom playlists in the API. I don't want to search existing playlists, I want to build a playlist based on video links that are cultivated for viewing.
I adapted my solution from this stackoverflow answer