Hi, I was looking at the JWPlayer documentation, and found this:
http://www.longtailvideo.com/support/ad ... ence-guide
Seems not a lot of work to implement this into Subsonic, and that would be a great improvement. Can it be done?
[]'s
Moderator: moderators
function init() {
var streamUrlPath = "${streamUrl}";
var srtPath = streamUrlPath.substring(0,streamUrlPath.length-6)+'737274';
var flashvars = {
id:"player1",
skin:"<c:url value="/flash/whotube.zip"/>",
// plugins:"metaviewer-1",
screencolor:"000000",
controlbar:"over",
autostart:"false",
bufferlength:3,
backcolor:"<spring:theme code="backgroundColor"/>",
frontcolor:"<spring:theme code="textColor"/>",
provider:"video"
};
plugins:"captions-2",
'captions.file':srtPath,
<.... here are code ....>
var player;
var position;
var maxBitRate = ${model.maxBitRate};
var timeOffset = ${model.timeOffset};
var streamUrlPath = "${streamUrl}";
var srtPath = streamUrlPath.substring(0,streamUrlPath.length-6)+'737274';
function init() {
var flashvars = {
id:"player1",
skin:"<c:url value="/flash/whotube.zip"/>",
// plugins:"metaviewer-1",
plugins:"captions-2",
'captions.file':srtPath,
screencolor:"000000",
controlbar:"over",
autostart:"false",
bufferlength:3,
backcolor:"<spring:theme code="backgroundColor"/>",
frontcolor:"<spring:theme code="textColor"/>",
provider:"video"
};
<.... here are code ....>
<sub:url value="/stream" var="streamUrlPath">
<sub:param name="path" value="${model.video.path}"/>
</sub:url>
<sub:url value="/stream" var="streamUrl">
<sub:param name="id" value="${model.video.id}"/>
</sub:url>
var streamUrlPath = "${streamUrlPath}";
<sub:url value="videoPlayer.view" var="baseUrl"><sub:param name="id" value="${model.video.id}"/></sub:url>
<sub:url value="main.view" var="backUrl"><sub:param name="id" value="${model.video.id}"/></sub:url>
<sub:url value="/stream" var="streamUrl">
<sub:param name="id" value="${model.video.id}"/>
</sub:url>
<sub:url value="/stream" var="streamUrlPath">
<sub:param name="path" value="${model.video.path}"/>
</sub:url>
<script type="text/javascript" src="<c:url value="/script/swfobject.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/prototype.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/scripts.js"/>"></script>
<script type="text/javascript" language="javascript">
var player;
var position;
var maxBitRate = ${model.maxBitRate};
var timeOffset = ${model.timeOffset};
var streamUrlPath = "${streamUrlPath}";
var srtPath = streamUrlPath.substring(0,streamUrlPath.length-6)+'737274';
plugins:"captions-2",
plugins:"./flash/captions.swf",
var flashvars = {
id:"player1",
skin:"<c:url value="/flash/whotube.zip"/>",
// plugins:"metaviewer-1",
plugins:"./flash/captions.swf",
'captions.file':srtPath,
screencolor:"000000",
controlbar:"over",
autostart:"false",
bufferlength:3,
backcolor:"<spring:theme code="backgroundColor"/>",
frontcolor:"<spring:theme code="textColor"/>",
provider:"video"
};
captions.swf
jw-player-5.6.swf
private var _config:Object = {
back: false,
label: undefined,
file: undefined,
state: true
};
private var _config:Object = {
back: false,
label: undefined,
file: undefined,
state: true,
offset: 0
};
_renderer = new Renderer(_defaults,_config.back);
_renderer = new Renderer(_defaults,_config.back,_config.offset);
private var _offset:Number;
private var _style:Object;
/** Constructor; solely inits the captions file loader. **/
public function Renderer(style:Object,outline:Boolean) {
/** Constructor; solely inits the captions file loader. **/
public function Renderer(style:Object,outline:Boolean,offset:Number) {
_offset = offset;
for (var i:Number=0; i<_captions.length; i++) {
if (_captions[i]['begin'] <= _position &&
(i == _captions.length-1 || _captions[i+1]['begin'] >= _position)) {
found = i;
break;
}
}
for (var i:Number=0; i<_captions.length; i++) {
if (_captions[i]['begin'] <= _position+_offset &&
(i == _captions.length-1 || _captions[i+1]['begin'] >= _position+_offset)) {
found = i;
break;
}
}
function init() {
var flashvars = {
id:"player1",
skin:"<c:url value="/flash/whotube.zip"/>",
// plugins:"metaviewer-1",
screencolor:"000000",
plugins:"./flash/captions.swf",
'captions.file':srtPath,
'captions.offset':timeOffset,
controlbar:"over",
autostart:"false",
bufferlength:3,
backcolor:"<spring:theme code="backgroundColor"/>",
frontcolor:"<spring:theme code="textColor"/>",
provider:"video"
};
var params = {
allowfullscreen:"true",
allowscriptaccess:"always"
};
var attributes = {
id:"player1",
name:"player1"
};
var width = "${model.popout ? '100%' : '600'}";
var height = "${model.popout ? '85%' : '360'}";
swfobject.embedSWF("<c:url value="/flash/jw-player-5.6.swf"/>", "placeholder1", width, height, "9.0.0", false, flashvars, params, attributes);
}
function changeTimeOffset() {
timeOffset = $("timeOffset").getValue();
player.remove();
var wrapperelement = document.getElementById("wrapper");
var placeholder = document.createElement('div');
placeholder.setAttribute('id','placeholder1');
wrapperelement.appendChild(placeholder);
init();
}
plugins:"./flash/captions.swf",
'captions.file':srtPath,
Users browsing this forum: No registered users and 4 guests