using dynamic smil file with jw player

大兔子大兔子 提交于 2019-12-21 02:35:17

问题


I'm trying to make a online stream player with JW Player 6.

If I create a smil file with all the quality version of streams and use the code below it works fine:

<script>
    jwplayer("myElement").setup({
        playlist: [{
            sources: [{
                file: "/player/smil.asp"
        }]
      }],
      type: 'rtmp'
    });
</script>

smil file:

<smil>
  <head>
    <meta base="rtmp://host/app" />
  </head>
  <body>
    <switch>
      <video src="quality1" system-bitrate="720" />
      <video src="quality2" system-bitrate="360" />
    </switch>
  </body>
</smil>

I want to create the smil file on the fly based on user's quality selections. (ie: discard bitrates higher than 720)

I used an asp file to create smil file dynamically but it didnt work:

file: "/player/smil.asp"

the error: Error loading player: No playable sources found

of course I set header type to application/octet-stream in the asp file but didnt solve the problem.

I also tried saving same asp file with smil extension and than set the asp handler for smil files in IIS setting. it works perfectly when I call in browser, but jw player shows same error.

any recommendation?

thanks.


回答1:


Defining type of source solves the problem.

sources: [{
    file: "/player/smil.asp",
    type: "rtmp"
}]

Thanks to Ethan for his patience.



来源:https://stackoverflow.com/questions/14944322/using-dynamic-smil-file-with-jw-player

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