Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在iframe中获取视频的持续时间?_Javascript_Php_Jquery_Iframe - Fatal编程技术网

Javascript 如何在iframe中获取视频的持续时间?

Javascript 如何在iframe中获取视频的持续时间?,javascript,php,jquery,iframe,Javascript,Php,Jquery,Iframe,我想知道如何获得iframe中youtube视频的持续时间(秒)。我真的不知道我应该使用PHP还是JS,所以我欢迎任何建议。这是我的iframe: <iframe width='420' height='315' id='video_player' src='https://www.youtube.com/embed/0rVwuowU6Fs' frameborder='1' allowfullscreen></iframe> 感谢您的回答。iframe的可能副本是h

我想知道如何获得iframe中youtube视频的持续时间(秒)。我真的不知道我应该使用PHP还是JS,所以我欢迎任何建议。这是我的iframe:

<iframe width='420' height='315' id='video_player' src='https://www.youtube.com/embed/0rVwuowU6Fs' frameborder='1' allowfullscreen></iframe>


感谢您的回答。

iframe的可能副本是https,无法使用javascript访问此内容,那么您只能使用google api。很好,谢谢您的建议。