Wowza VOD App with JW Player and SMIL file - not working on mobile

◇◆丶佛笑我妖孽 提交于 2019-12-11 10:07:45

问题


I posted this in the wowza forums but have gotten a total of 0 responses, so I wanted to post here as well. I haven't done a lot of media streaming work and I'm trying to close out some details of a VOD project that basically streams video to a website and have run into an issue with enabling the correct stream to go to the correct consumer (ex: android browser, chrome desktop browser, iOS, etc). I've cycled through a bunch of tutorials, forums, etc and can't find the right fix, including some of the questions here on SO...

Here's what I have set up: On Wowza: I have a VOD application set up

  • content directory:
    ${com.wowza.wms.context.VHostConfigHome}/content/Weekends
  • Playback types: MPEG-DASH, Apple HLS, Adobe RTMP, Adobe HDS, RTSP/RTP all
    enabled
  • SMIL file: sopweekendsmil.smil (contents below)

SMIL file (in the test url posted at the bottom I'm currently using a different than described in this SMIL due to privacy - the below is the SMIL file for the actual project):

<?xml version="1.0" encoding="UTF-8"?>
<smil title="">
    <body>
        <switch>
            <video height="240" src="SOP_priorities_240p.mp4" width="320">
                <param name="videoBitrate" value="1000000" valuetype="data"></param>
                <param name="audioBitrate" value="48000" valuetype="data"></param>
            </video>
            <video height="360" src="SOP_priorities_360p.mp4" width="640">
                <param name="videoBitrate" value="2000000" valuetype="data"></param>
                <param name="audioBitrate" value="48000" valuetype="data"></param>
            </video>
            <video height="480" src="SOP_priorities_480p.mp4" width="720">
                <param name="videoBitrate" value="2000000" valuetype="data"></param>
                <param name="audioBitrate" value="48000" valuetype="data"></param>
            </video>
            <video height="540" src="SOP_priorities_540p.mp4" width="960">
                <param name="videoBitrate" value="2500000" valuetype="data"></param>
                <param name="audioBitrate" value="48000" valuetype="data"></param>
            </video>
            <video height="720" src="SOP_priorities_720p.mp4" width="1280">
                <param name="videoBitrate" value="5000000" valuetype="data"></param>
                <param name="audioBitrate" value="48000" valuetype="data"></param>
            </video>
        </switch>
    </body>
</smil>

I have the above videos in the appropriate folder on the wowza server.

In the application webpage: I'm using JW Player and have the following code to embed JW Player (version 6.9):

<script type="text/javascript">
    jwplayer("myElement").setup({
        fallback: true,
        width: 640,
        height: 480,
        sources: [{
            file: "http://[serverurl]:[port]/Weekends/smil:sopweekendsmil.smil/jwplayer.smil"
        },{
            file: "http://[serverurl]:[port]/Weekends/smil:sopweekendsmil.smil/playlist.m3u8"
        },{
            file: "http://[serverurl]:[port]/Weekends/smil:sopweekendsmil.smil/manifest.f4m"
        },{
            file: "http://[serverurl]:[port]/Weekends/smil:sopweekendsmil.smil/manifest.mpd"
        }],
        rtmp: {
            bufferlength: '10'
        },
        plugins: {
             'qualitymonitor-2':{}
         }
    }); 
</script>

(I don't really know what the qualitymonitor plugin does or if it works at all. Seems to have no influence if I take it out...). I tried a bunch of variations with the JW Player syntax, but this worked on the desktop browsers (Chrome/Firefox). However, the only file/url that works correctly live seems to be the jwplayer.smil. None of the other ones work on the desktop browsers - I get a "No playable sources found" message if I take out the jwplayer.smil url to test the other ones. Also, this isn't working in any way on any mobile browsers no matter what I try. I've tried just a single file (ex: the .m3u8 smil url) and get the same error.

When I try the Test Players function in the Wowza server interface, the MPEG DASH test works correctly and the Adobe HDS works correctly (in chrome browser) but I can't seem to get those working outside of the Test Players.

I get the feeling that I'm missing some conceptual piece - do I need to create more actual files for the different consumers? Or is it possibly how I have JW Player set up? Or maybe something is being blocked?

Test URL: http://solsystech.com/

Any help would be greatly appreciated.

UPDATE: I got this partially working - I updated the embed code to the following:

jwplayer("myElement").setup({
      fallback: true,
      width: 640,
      height: 480,
      androidhls: true,
      sources: [{
          file: "<?php echo $jwUrl; ?>",
          type: "rtmp"
      },{
          file: "<?php echo $hlsUrl; ?>",
          type: "hls",
          "default": "true"
      },{
          file: "<?php echo $dashUrl; ?>",
          type: "dash"
      }],
      rtmp: {
          bufferlength: '10'
      }
  });

I tried turning RTMP off completely, as I understand this should be able to work without RTMP, but then nothing would play in chrome or firefox for OSX, so when I added that back in and made HLS the default, I was able to get the streams to play in mobile and desktop browsers correctly. If I have a different one as default, the mobile browsers don't play the stream...Still trying to solve why nothing on desktop browsers work if I don't stream in RTMP from Wowza...


回答1:


RTMP is a Flash format and will never play on mobile. HLS is the preferred format for maximum cross-device and cross-browser compatibility.



来源:https://stackoverflow.com/questions/33764552/wowza-vod-app-with-jw-player-and-smil-file-not-working-on-mobile

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