Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using dynamic smil file with jw player

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.

like image 920
dvdmn Avatar asked Oct 22 '22 17:10

dvdmn


1 Answers

Defining type of source solves the problem.

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

Thanks to Ethan for his patience.

like image 191
dvdmn Avatar answered Oct 25 '22 19:10

dvdmn