如何在iframe中获取内容视频并打印到网站上的代码

时间:2018-09-16 06:02:25

标签: javascript jquery html

我有一个隐藏iframe的php页面 我正在尝试获取路径为mp4的内容视频到标签输出“ ul”

<script type="text/javascript">
    #(document).ready(function) {
        $("#player-rapidvideo").load(fnction() {
            var iframeValues = $("#player-rapidvideo").contents().find("body div#home_video #videojs_html5_api").text().split("\n");
            var output = iframeValues;
            $.each(output, function(index, value) {
                callOutput($.trim(index), $.trim(value));
            });
        });
        finction callOutput(index, value) {
            if(value != '')
            // alert("[" + index + "]" + value);
            $("ul").append('<li id="' + index + '"> + value + '</li>');
        };
    });
</script>

<iframe id="player-rapidvideo" style="display:none;" src="iframe.html" scrolling="no" frameborder="0" width="100%" height="100%" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" marginheight="0"></iframe>
<ul>

</ul>

但是上面的代码不起作用。

这是HTML Iframe

<html><head><title>Iframe video</title></head>
<body style="" marginheight="0">
<div id="home_video" style="width: 100%; height: 100%;">
<div tabindex="-1" data-setup="{}" style="width: 100%; height: 100%; outline: none;" poster="file.jpg" preload="none" class="video-js vjs-big-play-centered vjs-paused vjs-controls-enabled vjs-workinghover vjs-v6 vjs-user-inactive" name="videojs" id="videojs" lang="vi-vn" role="region" aria-label="Video Player">
<video id="videojs_html5_api" name="videojs" class="vjs-tech" preload="none" poster="file.jpg" style="width:100%; height:100%;" data-setup="{}" tabindex="-1" src="path/file.mp4">
<source src="path/file.mp4" type="video/mp4" title="480p" data-res="480">
</video></div>
</html>

0 个答案:

没有答案