How to get return value using "getPlayerState" in YouTube player using iframe tag?

I gave the code that I used below to pause youtube video in an iframe that accepts a function with no parameters and return type. Please let me know how I can get the player’s status (ended, played, not started and similar) using the following code:

window.frames[playerName].postMessage(JSON.stringify({ "event": "command", "func": function, "args": 0, "id": 1 /*Can be omitted.*/ }), "*"); 
+4
source share

Source: https://habr.com/ru/post/1399363/


All Articles