简体   繁体   中英

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

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? There are other player ? so, i use JW6.9

You print php code instead of execute it, please replace

<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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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