Hi I greatly appreciated your workflow in the past. I tried to fix it but the problem doesn't seem to come from the YouTube API, but maybe I'm wrong. Here's my results so far.
If I visit a YouTube page, pause the video, and type the following code in the console, it works (the video plays):
var player = document.getElementById('movie_player');
player.startVideo();
When I type 'ytp' in the alfred bar though, the video doesn't play, and the console outputs 'Uncaught error: getPlayerState() not a function.' I checked on the API, the functions getPlayerState() and pauseVideo() are still there and are the same. The problem I found is that somehow the line 'var player = document.getElementById('movie_player');' in the Alfred workflow doesn't change the player variable. I tested this by typing 'player' in the Chrome console. It outputs a different default player object, for which of course there's no getPlayerState, etc. functions.
My conclusion was that... I was confused. I thought maybe the default player object already present is 'protected' and can't be overridden when Alfred executes the javascript code?
If you can get this action (ytp) to work, I am willing to update the rest of the workflow.
Thank you very much.