Streaming Video using 3.8

If you are like me, you have been holding off on upgrading to the latest Subsonic because you couldn't figure out how to get videos to stream in 3.8. After looking all over the place, I figured out that I could use all of my 3.7 settings, upgrade to 3.8 and then modify "./subsonic/WEB-INF/jsp/playlist.jsp" to allow video streams. The problem appears to have been with a recent change in jwplayer where the stream type must be specified as sound or video. Currently subsonic 3.8 sets all streams to sound. To allow videos to stream correctly, modify the skip method from:
to this:
This allows mp4's and flv's to stream correctly with the latest jwplayer and latest subsonic release.
- Code: Select all
function skip(index) {
if (index < 0 || index >= songs.length) {
return;
}
var song = songs[index];
currentStreamUrl = song.streamUrl;
updateCurrentImage();
var list = new Array();
list[0] = {
duration:song.duration,
file:song.streamUrl,
title:song.title,
type:"sound"
};
player.sendEvent("LOAD", list);
player.sendEvent("PLAY");
}
to this:
- Code: Select all
function skip(index) {
if (index < 0 || index >= songs.length) {
return;
}
var song = songs[index];
currentStreamUrl = song.streamUrl;
updateCurrentImage();
var list = new Array();
list[0] = {
duration:song.duration,
file:song.streamUrl,
title:song.title,
type:"sound"
};
if( song.format=="mp4" || song.format=="flv" ){
list[0]["type"]="video";
}
player.sendEvent("LOAD", list);
player.sendEvent("PLAY");
}
This allows mp4's and flv's to stream correctly with the latest jwplayer and latest subsonic release.