简体   繁体   English

如何使用JWPlayer插入视频

[英]How Insert Video with JWPlayer

I Have this code: 我有此代码:

<script src="http://jwpsrv.com/library/mykey.js"></script>
<div id="mediaplayer"></div>
<script type="text/javascript">
jwplayer("mediaplayer").setup({
file : '<?php echo $link_it; ?>' ,
width: 640 ,
height : 480
});
</script>

i have the link of the url in PHP... So, i use this code with a file.mp4 , but it doesn't work and tells me: File Not Found 我在PHP中拥有网址的链接...因此,我将此代码与file.mp4一起使用,但它不起作用并告诉我:找不到文件

I see in source of other website, this code: 我在其他网站的源代码中看到此代码:

<span class="jwmain"><span class="jwvideo">
    <video src="<?php echo $link_en; ?>"></video></span>
            </span>
            <script type="text/javascript">
                var playad          = false;
                var bannerad        = true;
                var ad_vid          = "";
                var width           = "640";
                var height          = "480";
                var swf             = "jwplayer/jwplayer.flash.swf";
                var vid             = new Array();
                var image           = new Array();
                var i               = new Array();
                vid[0]          = "<?php echo $link_en; ?>"; // i insert php
                image[0]        = "img.png";
                i[0]            = 0;
                loadplayer(0);

            </script>

And it doesn't work, i wrong how i use it probably... How i can to see my file .mp4? 而且它不起作用,我可能会错误地使用它...如何查看.mp4文件? There are other player ? 还有其他玩家吗? so, i use JW6.9 所以,我用JW6.9

You print php code instead of execute it, please replace 您打印php代码而不是执行它,请替换

<script type="text/javascript">
jwplayer("mediaplayer").setup({
file : '<?php echo $link_it; ?>' ,
width: 640 ,
height : 480
});
</script>

with: 有:

 <script type="text/javascript">
jwplayer("mediaplayer").setup({
file : <?php echo "'". $link_it ."'" ; ?>' ,
width: 640 ,
height : 480
});
</script>

Try this. 尝试这个。

Under this line of code: 在这行代码下:

file : '<?php echo $link_it; ?>' ,

Add this line: 添加此行:

type: 'mp4',

Does that help? 有帮助吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM