问题
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