How do i embed this m3u8 into jw player

僤鯓⒐⒋嵵緔 提交于 2019-12-03 09:47:51

问题


Total novice here so if you can be patient with me id really appreciate it.

Now i have this url

http://213.202.73.8:1234/data/channels/ARENA1. m3u8

I want to embed this into my JW Player, I have both Jw Player 5 & 6 So whatever is easiest, Can someone help a brother out and what code would i need to embed this so it plays on the JW Player if possible.

If you could write the FULL code so i can understand coz as i said a total novice here but fast learner lol.

Cheers guys

UPDATE:

Ok so i have had a little fiddle around and after have a look around came up with this code:

<script type='text/javascript' src='jwplayer2/jwplayer.js'></script>

<div id='mediaplayer'></div>

<script type="text/javascript">
jwplayer('mediaplayer').setup({
'id': 'playerID',
'width': '480',
'height': '270',
'file': 'http://213.202.73.8:1234/data/channels/ARENA1. m3u8',
'image': '/thumbs/bunny.jpg',
'modes': [
{type: 'html5'},
{type: 'flash', src: 'player.swf'},
{type: 'download'}
]
});
</script>

So it works in safari brilliantly but not in chrome, IE, or Firefox, Any ideas as to why, When i click the play button with those browsers nothing happens simply just doesnt load the timer type thing in the middle of the player doesnt go around its trying to load something but nothing in the player lol.

Cheers guys

UPDATE 2:

If its a link to the site here it is: http://testersite.byethost22. com/test.html

UPDATE 3:

Ive also tried another one and this time it says "The video could not be loaded, either because the server or network failed or because the format is not supported:"http: //video.popler.tv:554/publishlive/4funtv/playlist.m3u8"

You can see this here: http:// testersite.byethost22. com/u. html It says this in safari only though, same problem as before with chrome etc but now when i click on the player in chrome it simply downloads a playlist.m3u8

Hope someone can help, Cheers

UPDATE 4:

Ok so if you go here: http://testersite.byethost22.com/test5.html and try and play it with an idevice you will see it works perfectly but using chrome, firefox on my pc it simply does not work, im desperate now guys if someone can help me get this working on chrome and firefox i would be estastic and a very happy happy man!! as i said either would be fine jwp5 or jwp6 so as long as it works on chrome and firefox i really dont mind. Thanks guys and please someone help lol and yes i know theres gaps in some of the urls but i had to do it like that as i dont have enough reputation points to post more than 2 links.


回答1:


You are using JW Player 5 here, which does not support HLS (M3U8) on desktops (in Flash). Only JW6 Premium supports this. Here is a demo - http://www.longtailvideo.com/support/jw-player/29393/hls-adaptive-stream

Update, here is the code, it only works in JW6 Premium though:

<div id="myElement"></div>

<script>
    jwplayer("myElement").setup({
      image: "/uploads/myPoster.jpg",
      file: "/uploads/myManifest.m3u8",
    });
</script>



回答2:


Actually JW Player 6 Ads edition supports M3U8 and it says ads edition but no ads are displayed,you put this player in your .html file or wherever you want this player to play your live streams or m3u8 playlist, here are the codes i compiled:

<head>
    <style>*{margin:0;padding:0;}</style>
    <script data-cfasync="false" src="http://jwpsrv.com/library/SakQCEfSEeOHhRIxOQfUww.js"></script>
</head>
<body>
   <div id="playerjxJRqLMFuJaA_wrapper" style="position: relative; display: block; width: 100%; height: 490px;">
      <a id="beforeswfanchor0" href="#playerjxJRqLMFuJaA" tabindex="0" title="Flash start" style="border:0;clip:rect(0 0 0 0);display:block;height:1px;margin:-1px;outline:none;overflow:hidden;padding:0;position:absolute;width:1px;" data-related-swf="playerjxJRqLMFuJaA"></a>

      <object type="application/x-shockwave-flash" data="http://p.jwpcdn.com/6/12/jwplayer.flash.swf" width="100%" height="100%" bgcolor="#000000" id="playerjxJRqLMFuJaA" name="playerjxJRqLMFuJaA" class="jwswf swfPrev-beforeswfanchor0 swfNext-afterswfanchor0" tabindex="0">
         <param name="allowfullscreen" value="true">
         <param name="allowscriptaccess" value="always">
         <param name="seamlesstabbing" value="true">
         <param name="wmode" value="opaque">
       </object>

       <a id="afterswfanchor0" href="#playerjxJRqLMFuJaA" tabindex="0" title="Flash end" style="border:0;clip:rect(0 0 0 0);display:block;height:1px;margin:-1px;outline:none;overflow:hidden;padding:0;position:absolute;width:1px;" data-related-swf="playerjxJRqLMFuJaA"></a>

       <div id="playerjxJRqLMFuJaA_aspect" style="display: none;">
       </div>

       <div id="playerjxJRqLMFuJaA_jwpsrv" style="position: absolute; top: 0px; z-index: 10;"><div class="afs_ads" style="width: 1px; height: 1px; position: absolute; background: transparent;">&nbsp;
       </div>
    </div>

  <script data-cfasync="false" type="text/javascript">
    jwplayer('playerjxJRqLMFuJaA').setup({
    file: 'http://proxy-031.dc3.dailymotion.com/sec(11eb80ed8bb344d448fb7eff4cafbe08)/video/754/581/309185457_mp4_h264_aac_hd_hfr.m3u8',
    file: 'http://proxy-031.dc3.dailymotion.com/sec(11eb80ed8bb344d448fb7eff4cafbe08)/video/754/581/309185457_mp4_h264_aac_hd_hfr.m3u8',
        aboutlink: 'http://skysports.com',
        controls: 'true',
        title: 'Football Live Streamings.Com',
        width: '100%',
        height: '490',
        stretching: 'uniform',
        autostart: 'true',
        primary: 'flash',
        skin: 'vapor',
        androidhls: 'true',     
    });
  </script>

</body>


来源:https://stackoverflow.com/questions/14988021/how-do-i-embed-this-m3u8-into-jw-player

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!