1

with check this example, http://developer.longtailvideo.com/player/branches/adaptive/test/provider.html , I tried the example myself, There is my code:

<html>
<head>

    <script type="text/javascript" src="jwplayer.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <title>Provider tests</title>
    <style>
        body { padding: 50px; font: 13px/20px Arial; background: #EEE; }
        form { margin-top: 20px; }
        #player { -webkit-box-shadow: 0 0 5px #999; background: #000; }
        ul { margin-top: 40px; padding: 0 0 0 20px; list-style-type: square; }
    </style>

</head>
<body>

    Test M3U8
    <div id="player">You need Flash to play these tests</div>

    <script type="text/javascript">
        jwplayer("player").setup({
            file: '../m3u8/index.m3u8',
            flashplayer: 'player.swf',
            provider:'adaptiveProvider.swf',
            height: 360,
            width: 640
        });
        function loadStream(url) {
            jwplayer("player").load({file: url,provider: 'adaptiveProvider.swf'});
            jwplayer("player").play();
            return false;
        }

        $(document).ready(function() {
            loadStream('http://localhost/m3u8/index.m3u8');
        });
    </script>
    <ul id="streamlist"></ul>
    <div id="panel"></div>
</body>
</html> 

But the Jw Play can not work

BTW: my vlc can play http://localhost/m3u8/index.m3u8 well

why
  • 23,923
  • 29
  • 97
  • 142
  • This has been asked since but apparently it also got no quality answers: https://stackoverflow.com/questions/14988021/how-do-i-embed-this-m3u8-into-jw-player – chiliNUT May 02 '20 at 07:05

2 Answers2

1

It seems you need to buy premium jwplayer license in order to play m3u8 streams. You can read about it in their site

http://www.jwplayer.com/pricing/

It says Apple HLS Streams under the third box, which is what m3u8 really is.

whotheman
  • 117
  • 1
  • 2
  • 13
0

Perhaps it's a missing !DOCTYPE declaration that you don't have.

I don't have ability to test this personally, but try this version that also includes other fixes based on the original file.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>Provider tests</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">

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

<style type="text/css">
/*<![CDATA[*/
        body { padding: 50px; font: 13px/20px Arial; background: #EEE; }
        form { margin-top: 20px; }
        #player { -webkit-box-shadow: 0 0 5px #999; background: #000; }
        ul { margin-top: 40px; padding: 0 0 0 20px; list-style-type: square; }
/*]]>*/
</style>

</head>
<body>

Test M3U8

<div id="player">You need Flash to play these tests</div>

<script type="text/javascript">
//<![CDATA[
        jwplayer("player").setup({
            file: '../m3u8/index.m3u8',
            flashplayer: 'player.swf',
            provider:'adaptiveProvider.swf',
            height: 360,
            width: 640
        });
        function loadStream(url) {
            jwplayer("player").load({file: url,provider: 'adaptiveProvider.swf'});
            jwplayer("player").play();
            return false;
        }

//]]>
</script>

<ul id="streamlist"></ul>
<div id="panel"></div>

<script type="text/javascript">
//<![CDATA[
        $(document).ready(function() {
            loadStream('http://localhost/m3u8/index.m3u8');
        });
//]]>
</script>

</body>
</html>

EDIT: Note that you will have to be on the same Domain for this to work. Also, jwPlayer forum mentions that .m3u8 works only for iOS and Safari. Reference HERE.

To test a valid .m3u8 streaming playback webpage provided by LongTail Video website with your device, access this WEBPAGE. Caution when using desktop browser! It or VLC Media Player Plugin might crash with a sad face.

arttronics
  • 9,957
  • 2
  • 26
  • 62