Using dynamic smil file with jw player

I am trying to create an online player with JW Player 6.

If I create a smil file with all the quality version of the 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 a smil file on the fly based on the choice of user quality. (i.e.: drop bitrates above 720)

I used the asp file to create the smil file dynamically, but it did not work:

file: "/player/smil.asp"

error: Error loading player: no playback sources available

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

asp smil asp- smil IIS. , jw .

?

.

+5
1

.

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

.

+3

All Articles