sb.append("<source src=\"/media/").append(id1).append("\" type=\"").append(mime).append("\">");
}
sb.append(CRLF);
if (flowplayer) {
PmsConfiguration configuration = PMS.getConfiguration();
boolean isFFmpegFontConfig = configuration.isFFmpegFontConfig();
if (isFFmpegFontConfig) { // do not apply fontconfig to flowplayer subs
configuration.setFFmpegFontConfig(false);
}
OutputParams p = new OutputParams(configuration);
Player.setAudioAndSubs(r.getName(), r.getMedia(), p);
if (p.sid !=null && p.sid.getType().isText()) {
try {
File subFile = SubtitleUtils.getSubtitles(r, r.getMedia(), p, configuration, SubtitleType.WEBVTT);
LOGGER.debug("subFile " + subFile);
if (subFile != null) {
sb.append("<track src=\"/subs/").append(subFile.getAbsolutePath()).append("\">");
}
} catch (Exception e) {
LOGGER.debug("error when doing sub file " + e);
}
}
configuration.setFFmpegFontConfig(isFFmpegFontConfig); // return back original fontconfig value
}
sb.append("</").append(mediaType).append(">").append(CRLF);
if (flowplayer) {
sb.append("</div>").append(CRLF);
}
// nex and prev buttons
sb.append("<div>").append(CRLF);
sb.append("<button value=\"<<\" onclick=\"").append(prvJs).append("\"><<</button>").append(CRLF);
sb.append("<button value=\">>\" onclick=\"").append(nxtJs).append("\">>></button>").append(CRLF);
sb.append("</div>").append(CRLF);
sb.append("</div>").append(CRLF);
sb.append("<a href=\"/raw/").append(rawId).append("\" target=\"_blank\" id=\"DownloadLink\" title=\"Download this video\"></a>").append(CRLF);
if (flowplayer) {
sb.append("<script>").append(CRLF);
sb.append("$(function() {").append(CRLF);
if (configuration.getWebAutoCont(r.getFormat())) {
// auto continue for flowplayer
sb.append("var api = $(\".player\").flowplayer();").append(CRLF);
sb.append(" api.bind(\"finish\",function() {").append(CRLF);
sb.append(nxtJs).append(CRLF);
sb.append(" });").append(CRLF);
}
sb.append(" $(\".player\").flowplayer({").append(CRLF);
sb.append(" ratio: 9/16,").append(CRLF);
sb.append(" flashfit: true").append(CRLF);
sb.append(" });").append(CRLF);
sb.append("});").append(CRLF);
sb.append("</script>").append(CRLF);
} else {
if (configuration.getWebAutoCont(r.getFormat())) {
// logic here use our own id (for example 123)
// once we're done ask for /play/123?nxt=true
// the nxt will cause us to pick next (most likely 124) from list.
sb.append("<script>").append(CRLF);
sb.append("var player = document.getElementById(\"player\");").append(CRLF);