-1

I did RTMP streaming it is working fine for me, But now client needs HLS streaming, here is my code for RTMP streaming

var playerInstance = jwplayer("containerForShortVideo");
                    playerInstance.setup({
                    image: "' .Main_VideoUrl(ImagesUrl($VideoDetails[0])) /*S3_VIDEO_BUCKETABSOLUTE_PATH . $VideoDetails[0]['ImageName']*/ . '",    
                    autostart: false,
                    sources: [
                            {
                              file: "' . S3_VIDEO_BUCKETABSOLUTE_PATH . $highResolutionURL . '",
                              label: "1080p",
                              type: "mp4"
                            },
                            {
                              file: "' . S3_VIDEO_BUCKETABSOLUTE_PATH . $VideoDetails[0]['VideoStreamURL'] . '",
                              label: "480p",
                              type: "mp4"
                            },
                            {
                              file: "' . S3_VIDEO_BUCKETABSOLUTE_PATH . $mediumResolutionURL . '",
                              label: "360p",
                              default: "true",
                              type: "mp4"
                            },
                            {
                              file: "' . S3_VIDEO_BUCKETABSOLUTE_PATH . $lowResolutionURL . '",
                              label: "240p",
                              type: "mp4"
                            }
                    ],
                    advertising: {
                    client: "vast",
                    schedule: {
                    adbreak1: {
                        offset: "pre",
                        tag: "'.$adurl1.'", 
                    },
                    adbreak2: {
                        offset:"'.$adurmidtime.'",
                        tag: "'.$adurl2.'",
                    },
                    adbreak3: {
                        offset: "post",
                        tag: "'.$adurl3.'",
                    },
                      }
                  }
                    });

Can anyone please tell me how can i convert this into HLS streaming ?

Nikul
  • 465
  • 1
  • 8
  • 24

2 Answers2

1

JW Player can't convert the video for you - you'll need to do it on a media server, probably whatever server you're getting the video from. Maybe there's already an HLS version of the video on that server (it would end with "/playlist.m3u8".)

libertyernie
  • 2,590
  • 1
  • 17
  • 13
  • thanks for your comment, I did HLS streaming in amazon, Here is the URL for streaming, `transcodingvideo.s3.amazonaws.com/Videos/Streaming/hls1080m_Videos_24_300_1453265755167` you can check that when i run this URL it allows me to download rather than to play, Can you please let me know how to play this video ? – Nikul Jan 20 '16 at 05:55
  • Your Link is not accessible , but generally HLS playlist represented as file with extension m3u8 – Pirks Jan 25 '16 at 11:56
0

If you want to play HLS with JWPlayer just add to your page something like:

    <script type="text/javascript">
jwplayer.key = "hh456456FDGDFGDFGFDGFdasfsdf";
jwplayer("video_player").setup({
    file: "http://myserver/file.m3u8",
    image: "http://myserver/mycoverimage.jpg",
    width: "100%",
    aspectratio: "16:9",
    androidhls: true,
    autostart: true,
    fallback: true,
    wprimary: 'flash',
}).onSetupError(function (error) {
    console.log(error);
});
</script>
Pirks
  • 322
  • 2
  • 4
  • 16
  • Can you please tell me what will be the m3u8 file ? Can you please give me code for that file? – Nikul Jan 25 '16 at 12:10
  • m3u8 is playlist of Apple HLS video streaming. Typically it contains the list of media files in format of *.ts where each media file represents number of seconds video+audio (typically 10). m3u8 and ts files can be created using set of tools provided by apple like : mediafilesegmenter, mediastreamsegmenter, variantplaylistcreator. Also it is possible to create ts mediafiles from mp4 or avi files using FFMpeg and playlist create manually or using your own code. – Pirks Jan 26 '16 at 14:19