/*****************************************************
*
* Copyright 2010 Adobe Systems Incorporated. All Rights Reserved.
*
*****************************************************
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
*
* The Initial Developer of the Original Code is Adobe Systems Incorporated.
* Portions created by Adobe Systems Incorporated are Copyright (C) 2010 Adobe Systems
* Incorporated. All Rights Reserved.
*
*****************************************************/
/**
* jQuery plugin that generate the necessary video playback mark-up.
* @param {Object} /iPad/i
*/
(function($, undefined){
var userAgent = navigator.userAgent;
var isiPad = userAgent.match(/iPad/i) != null;
var isiPhone = userAgent.match(/iPhone/i) != null;
var StrobeMediaPlayback = function(element, options){
this.$element = $(element);
this.options = $.extend({}, $.fn.strobemediaplayback.defaults, options);
};
var methods = {
initialize: function(){
if (!this.options.html5) {
this.options.html5 = (isiPad || isiPhone);
}
//console.log(this.options);
if (!this.options.html5) {
this.options.queryString = $.fn.strobemediaplayback.generateQueryString(this.options);
}
// Use the generated template function
var videoMarkupCode = generateHTMLCode(this.options);
this.$element.append(videoMarkupCode);
//this.$element.data("video", this.$element.find("#"+this.options.id));
//videoHeight = this.options.height;
if (this.options.html5 && this.options.javascriptControls) {
onJavaScriptBridgeCreated(this.options.id, true);
}
}
}
StrobeMediaPlayback.prototype = methods;
$.fn.strobemediaplayback = function(options){
var instances = [], i;
var result = this.each(function(){
instances.push(new StrobeMediaPlayback(this, options));
});
for (i = 0; i < instances.length; i++) {
instances[i].initialize();
}
return result;
};
/**
* Plug-in default values
*/
$.fn.strobemediaplayback.defaults = {
controlBarMode: "docked",
controlBarAutoHide: false,
controlBarAutoHideTimeout: 10,
swf: "http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf"
};
/**
* Utitility method that will retrieve the page parameters from the Query String.
*/
$.fn.strobemediaplayback.parseQueryString = function(queryString){
var options = {};
var queryPairs = queryString.split('&'), queryPair, n = queryPairs.length;
for (var i = 0; i < n; i++) {
queryPair = queryPairs[i].split('=');
if (queryPair[1] == "true" || queryPair[1] == "false") {
options[queryPair[0]] = (queryPair[1] == "true");
}
else {
var number = parseFloat(queryPair[1]);
if (!isNaN(number)) {
options[queryPair[0]] = number;
}
else {
options[queryPair[0]] = queryPair[1];
}
}
}
return options;
}
/**
* Utitility method that will retrieve the page parameters from the Query String.
*/
$.fn.strobemediaplayback.generateQueryString = function(options){
var queryStrings = [];
for (var key in options) {
if (queryStrings.length > 0) {
queryStrings.push("&");
}
queryStrings.push(encodeURIComponent(key));
queryStrings.push("=");
queryStrings.push((options[key]));
}
return queryStrings.join("");
}
function generateHTMLCode(options){
options.data = options;
var embedHTML = videoTemplate($, options).join("");
return embedHTML;
}
/*
* Private function generated using http://api.jquery.com/template/
*
* You can change the template is in the template-generator.html page.
* The update process of the template function is a manual process, at this moment.
*/
function videoTemplate(jQuery, $item){
var $ = jQuery, call, _ = [], $data = $item.data;
with ($data) {
_.push("");
if (typeof html5 !== "undefined" &&
html5 != null &&
(typeof html5 === "function" ? html5.call($item) : html5)) {
_.push(" <video id=\"");
if (typeof id !== "undefined" && id != null) {
_.push($.encode(typeof id === "function" ? id.call($item) : id));
}
_.push("\" class=\"smp_video\" ");
if (typeof poster !== "undefined" &&
poster != null &&
(typeof poster === "function" ? poster.call($item) : poster)) {
_.push(" poster=\"");
if (typeof poster !== "undefined" && poster != null) {
_.push($.encode(typeof poster === "function" ? poster.call($item) : poster));
}
_.push("\" ");
}
_.push(" ");
if (typeof(controlBarMode && controlBarMode != "none") !== "undefined" &&
(controlBarMode && controlBarMode != "none") != null &&
(typeof(controlBarMode && controlBarMode != "none") === "function" ? (controlBarMode && controlBarMode != "none").call($item) : controlBarMode && controlBarMode != "none")) {
_.push(" controls=\"controls\" ");
}
_.push(" height=\"");
if (typeof height !== "undefined" && height != null) {
_.push($.encode(typeof height === "function" ? height.call($item) : height));
}
_.push("\" width=\"");
if (typeof width !== "undefined" && width != null) {
_.push($.encode(typeof width === "function" ? width.call($item) : width));
}
_.push("\"> <source src=\"");
if (typeof src !== "undefined" && src != null) {
_.push($.encode(typeof src === "function" ? src.call($item) : src));
}
_.push("\" type=\"video/mp4\" /> ");
if (typeof src_ogg !== "undefined" &&
src_ogg != null &&
(typeof src_ogg === "function" ? src_ogg.call($item) : src_ogg)) {
_.push("<source src=\"");
if (typeof src_ogg !== "undefined" && src_ogg != null) {
_.push($.encode(typeof src_ogg === "function" ? src_ogg.call($item) : src_ogg));
}
_.push("\" type=\"video/ogg\" />");
}
_.push(" </video> ");
}
else {
_.push(" ");
if (typeof swf !== "undefined" &&
swf != null &&
(typeof swf === "function" ? swf.call($item) : swf)) {
_.push(" <object id=\"");
if (typeof id !== "undefined" && id != null) {
_.push($.encode(typeof id === "function" ? id.call($item) : id));
}
_.push("\" name=\"");
if (typeof id !== "undefined" && id != null) {
_.push($.encode(typeof id === "function" ? id.call($item) : id));
}
_.push("\" data=\"");
if (typeof swf !== "undefined" && swf != null) {
_.push($.encode(typeof swf === "function" ? swf.call($item) : swf));
}
_.push("\" width=\"");
if (typeof width !== "undefined" && width != null) {
_.push($.encode(typeof width === "function" ? width.call($item) : width));
}
_.push("\" height=\"");
if (typeof height !== "undefined" && height != null) {
_.push($.encode(typeof height === "function" ? height.call($item) : height));
}
_.push("\" type=\"application/x-shockwave-flash\"> <param name=\"movie\" value=\"");
if (typeof swf !== "undefined" && swf != null) {
_.push($.encode(typeof swf === "function" ? swf.call($item) : swf));
}
_.push("\" /><param name=\"flashvars\" value=\"");
if (typeof queryString !== "undefined" &&
queryString != null) {
_.push($.encode(typeof queryString === "function" ? queryString.call($item) : queryString));
}
_.push("\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"wmode\" value=\"opaque\" /> </object> ");
}
else {
_.push(" <object id=\"");
if (typeof id !== "undefined" && id != null) {
_.push($.encode(typeof id === "function" ? id.call($item) : id));
}
_.push("\" name=\"");
if (typeof id !== "undefined" && id != null) {
_.push($.encode(typeof id === "function" ? id.call($item) : id));
}
_.push("\" width=\"");
if (typeof width !== "undefined" && width != null) {
_.push($.encode(typeof width === "function" ? width.call($item) : width));
}
_.push("\" height=\"");
if (typeof height !== "undefined" && height != null) {
_.push($.encode(typeof height === "function" ? height.call($item) : height));
}
_.push("\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"> <param name=\"movie\" value=\"");
if (typeof swf !== "undefined" && swf != null) {
_.push($.encode(typeof swf === "function" ? swf.call($item) : swf));
}
_.push("\" /><param name=\"flashvars\" value=\"");
if (typeof queryString !== "undefined" &&
queryString != null) {
_.push($.encode(typeof queryString === "function" ? queryString.call($item) : queryString));
}
_.push("\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"wmode\" value=\"opaque\" /> </object>");
}
_.push(" ");
}
_.push("");
}
return _;
}
$.encode = function(text){
// Do HTML encoding replacing < > & and ' and " by corresponding entities.
return ("" + text).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'");
}
})(jQuery);
/**
* jQuery plugin - will generate custom video playback controls
*/
(function($, undefined){
var userAgent = navigator.userAgent;
var isiPad = userAgent.match(/iPad/i) != null;
var isiPhone = userAgent.match(/iPhone/i) != null;
var writableProperties = "src preload currentTime defaultPlaybackRate playbackRate autoplay loop controls volume muted".split(" ");
var timeRangeProperties = "played seekable buffered".split(" ");
var timeRangeMethods = {
start: function(index){
return this._start[index];
},
end: function(index){
return this._end[index];
}
}
var monitorChanges = function(monitor){
var i = writableProperties.length;
while (i--) {
var propertyName = writableProperties[i];
if (monitor.cc.hasOwnProperty(propertyName) &&
monitor.videoElement.hasOwnProperty(propertyName) &&
monitor.cc[propertyName] != monitor.videoElement[propertyName]) {
//alert("changed");
monitor.cc[propertyName] = monitor.videoElement[propertyName];
var setter = "set" + propertyName.charAt(0).toUpperCase() + propertyName.substring(1);
monitor.$strobeMediaPlayback[0][setter](monitor.videoElement[propertyName]);
}
}
setTimeout(function(){
monitorChanges(monitor)
}, 500);
};
var VideoElementMonitor = function($strobeMediaPlayback){
//this.cc = {};
this.$strobeMediaPlayback = $strobeMediaPlayback;
this.strobeMediaPlayback = $strobeMediaPlayback[0];
this.videoElement = {
duration: 0,
currentTime: 0,
paused: true
};
this.cc = {
duration: 0,
currentTime: 0,
paused: true
};
//
this.videoElement.play = jQuery.proxy(this.strobeMediaPlayback.play2, this.strobeMediaPlayback);
this.videoElement.pause = jQuery.proxy(this.strobeMediaPlayback.pause, this.strobeMediaPlayback);
this.videoElement.load = jQuery.proxy(this.load, this);// jQuery.proxy(this.strobeMediaPlayback.load, this.strobeMediaPlayback);
this.$videoElement = $(this.videoElement);
}
var videoElementMonitorMethods = {
load: function()
{
this.strobeMediaPlayback.setSrc(this.videoElement.src);
this.strobeMediaPlayback.load();
},
update: function(properties, events, monitor){
//alert(properties);
var propertyName;
for (propertyName in properties) {
if (events.indexOf("emptied") < 0
&& monitor.cc.hasOwnProperty(propertyName)
&& monitor.cc[propertyName]
&& monitor.videoElement[propertyName]
&& monitor.cc[propertyName] != monitor.videoElement[propertyName]) {
// this value changed in JS
continue;
}
monitor.cc[propertyName] = properties[propertyName];
monitor.videoElement[propertyName] = properties[propertyName];
if (timeRangeProperties.indexOf(propertyName) >= 0) {
monitor.videoElement[propertyName].start = timeRangeMethods.start;
monitor.videoElement[propertyName].end = timeRangeMethods.end;
}
}
if (events) {
var i = events.length;
while (i--) {
monitor.$videoElement.triggerHandler(events[i]);
}
}
}
}
VideoElementMonitor.prototype = videoElementMonitorMethods;
var StrobeMediaPlaybackChrome = function(element, options){
this.$window = $(window);
this.$document = $(document);
this.$element = $(element);
this.options = $.extend({}, $.fn.strobemediaplaybackchrome.defaults, options);
};
var methods = {
initialize: function(){
// Check if the element contains any controls, generate the content otherwise.
this.play = this.$element.find('.smp.play');
if (!this.play) {
var markupCode = generateHTMLCode(this.options);
this.$element.append(markupCode);
this.play = this.$element.find('.smp.play');
}
this.$player = $("#" + this.options.id)
this.player = this.$player.get(0);
if (this.player.getState) {
this.monitor = new VideoElementMonitor(this.$player);
this.$player.data("videoElement", this.monitor.$videoElement);
this.player = this.monitor.videoElement;
this.$player = this.monitor.$videoElement;
//this.player = new StrobeMediaPlaybackToHtml5VideoBridge(this.player, this);
//this.player = new Html5VideoAdaptGetterSetterToFunction(this.player);
//this.$player = $(new Html5VideoAdaptGetterSetterToFunction(this.player));
org.strobemediaplayback.proxied[this.options.id] = this.monitor;
this.isHTML5 = false;
monitorChanges(this.monitor);
}
else {
//this.$player.data("videoElement", this.$player);
// Html5VideoAdaptGetterSetterToFunction.prototype = adapterMethods;
//this.player = new Html5VideoAdaptGetterSetterToFunction(this.player);
//this.$player = $();
this.isHTML5 = true;
}
this.sliding = false;
this.playOverlay = this.$element.find('.playoverlay');
this.mute = this.$element.find('.smp.volume');
this.time = this.$element.find('.time');
this.currentTimeLabel = this.$element.find('.currentTime');
this.durationLabel = this.$element.find('.duration');
this.errorOverlay = this.$element.find('.smp-error');
this.play.bind('click', this, this.onPlayClick);
this.playOverlay.bind('click', this, this.onPlayClick);
this.mute.bind('click', this, this.onMuteClick);
this.$player.bind("play", this, this.onPlay);
this.$player.bind("pause", this, this.onPause);
this.$player.bind("volumechange", this, this.onVolumeChange);
this.$player.bind("durationchange", this, this.onDurationChange);
this.$player.bind("timeupdate", this, this.onTimeUpdate);
this.$player.bind("waiting", this, this.onWaiting);
this.$player.bind("seeking", this, this.onSeeking);
this.$player.bind("seeked", this, this.onSeeked);
this.$player.bind("ended", this, this.onPause);
this.$player.bind("error", this, this.onError);
this.$player.bind("progress", this, this.onProgress);
this.timeTrack = this.$element.find(".video-track");
this.slider = this.$element.find(".slider");
this.played = this.$element.find(".played");
this.buffered = this.$element.find(".buffered");
this.slider.bind("mousedown", this, this.onSliderMouseDown);
this.slider.bind("touchstart", this, this.onSliderMouseDown);
//this.slider.bind("touchmove", this, this.onSliderMouseDown);
this.timeTrack.bind('mousedown', this, this.onTimeTrackClick);
this.$window.bind("orientationchange", this, this.onOrinetationChangeOrResize);
this.$window.bind("resize", this, this.onOrinetationChangeOrResize);
this.layoutControlBar(this.options.width, this.options.height);
},
onSliderMouseDown: function(event){
var duration, time, player;
if (!event.data.sliding) {
event.preventDefault();
// TODO: Move the sliding code into a special widget
player = event.data.player;
event.data.sliding = true;
duration = player.duration;
var timeTrack = event.data.timeTrack;
var slider = event.data.slider;
var moveTarget = event.data.$document;
moveTarget.bind("mousemove", event.data, onMouseMove);
moveTarget.bind("touchmove", event.data, onMouseMove);
moveTarget.bind("mouseup", event.data, onMouseUp);
moveTarget.bind("touchend", event.data, onMouseUp);
moveTarget.bind("touchcancel", event.data, onTouchCancel);
}
function onMouseMove(event){
event.preventDefault();
var timeTrackWidth = event.data.timeTrack.outerWidth();
var offsetLeft = event.data.timeTrack.offset().left;
var x = event.clientX;
var originalEvent = event.originalEvent;
if (typeof x == 'undefined' && originalEvent && originalEvent.touches && originalEvent.touches.length > 0) {
x = originalEvent.touches[0].pageX;
}
var relativePosition = (x - offsetLeft) / (timeTrackWidth);
time = duration * relativePosition;
if (time < duration && time > 0) {
var timePercent = (Math.max(0, time) / duration * 100);
//$("#debug").html("duration" + duration + '<br />' + timePercent + '<br />');
//$("#seekDebug").html("clientX=" + x + " width=" + timeTrackWidth + " duration=" + duration + " time=" + time);
event.data.slider.css({
"left": timePercent + "%"
});
event.data.played.css({
"width": timePercent + "%"
});
event.data.seekTime = time;
event.data.onProgress(event);
}
};
function onMouseUp(event){
moveTarget.unbind("mousemove");
moveTarget.unbind("touchmove");
moveTarget.unbind("mouseup");
moveTarget.unbind("touchend");
if (time > 0) {
event.data.seekTime = 0;
player.currentTime = time;
}
event.data.sliding = false;
};
function onTouchCancel(event){
event.data.seekTime = 0;
event.data.sliding = false;
};
},
onOrinetationChangeOrResize: function(event){
event.data.layoutControlBar(event.data.options.width, event.data.options.height);
},
onPlayClick: function(event){
var player = event.data.player;
if (player.paused) {
player.play();
}
else {
player.pause();
}
},
onMuteClick: function(event){
var player = event.data.player;
player.muted = !player.muted;
},
onTimeTrackClick: function(event){
var duration = event.data.player.duration;
var timeTrackWidth = event.data.timeTrack.outerWidth();
var offsetLeft = event.data.timeTrack.offset().left;
var relativePosition = (event.clientX - offsetLeft) / (timeTrackWidth);
var time = duration * relativePosition;
//alert(event.clientX + " " + width + " " + timeTrackWidth + " " + duration + " " + time + " " + relativePosition);
if (time > 0) {
event.data.player.currentTime = time;
}
//monitorChanges(event.data.monitor);
// $("#seekDebug").html("clientX=" + event.clientX + " width=" + timeTrackWidth + " duration=" + duration + " time=" + time);
},
onPlay: function(event){
event.data.errorOverlay.hide();
event.data.play.removeClass("play").addClass("pause");
if (event.data.isHTML5 && event.data.options.playButtonOverlay) {
event.data.playOverlay.fadeOut(600);
}
},
onPause: function(event){
event.data.play.removeClass("pause").addClass("play");
if (event.data.isHTML5 && event.data.options.playButtonOverlay) {
event.data.playOverlay.fadeIn(600);
}
},
onWaiting: function(event){
$("#debug").append("BUFFERING");
event.data.buffered.css({
"width": 0
});
},
onError: function(event){
$("#debug").append("ERROR" + event.data.player.error.code);
if (event.data.isHTML5)
{
var message;
switch (event.target.error.code) {
case event.target.error.MEDIA_ERR_ABORTED:
message = 'You aborted the video playback.';
break;
case event.target.error.MEDIA_ERR_NETWORK:
message = 'A network error caused the video download to fail part-way.';
break;
case event.target.error.MEDIA_ERR_DECODE:
message = 'The video playback was aborted due to a corruption problem or because the video used features your browser did not support.';
break;
case event.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
message = 'The video could not be loaded, either because the server or network failed or because the format is not supported.';
break;
default:
message = 'An unknown error occurred.';
break;
}
$("#debug").append(message);
event.data.errorOverlay.html(message);
event.data.errorOverlay.show();
}
},
onSeeking: function(event){
$("#debug").append("SEEKING");
},
onSeeked: function(event){
$("#debug").append("SEEKED");
event.data.buffered.show();
},
onVolumeChange: function(event){
if (event.data.player.muted) {
event.data.mute.addClass("mute");
}
else {
event.data.mute.removeClass("mute");
}
},
onDurationChange: function(event){
var duration = event.data.player.duration;
var currentTime = event.data.player.currentTime;
var timeDuration = formatTimeStatus(currentTime, duration);
event.data.currentTimeLabel.html(timeDuration[0]);
event.data.durationLabel.html(timeDuration[1]);
},
onTimeUpdate: function(event){
if (event.data.sliding) {
return;
}
var duration = event.data.player.duration;
var currentTime = event.data.player.currentTime;
var timeDuration = formatTimeStatus(currentTime, duration);
event.data.currentTimeLabel.html(timeDuration[0]);
event.data.durationLabel.html(timeDuration[1]);
var timePercent = (Math.max(0, currentTime) / duration * 100);
event.data.slider.css({
"left": timePercent + "%"
});
event.data.played.css({
"width": timePercent + "%"
});
event.data.onProgress(event);
},
onProgress: function(event){
var bufferedPercent = 0;
var buffered = event.data.player.buffered;
var time = event.data.seekTime || Math.max(0, event.data.player.currentTime);
//$("#debug").append(buffered.length + "-" + buffered.end(buffered.length - 1));
var timePercent = time / event.data.player.duration * 100;
if (buffered) {
var lastBuffered = buffered.end(buffered.length - 1);
bufferedPercent = (lastBuffered / event.data.player.duration) * 100;
bufferedPercent -= timePercent;
//$("#debug").append(bufferedPercent);
}
if (timePercent + bufferedPercent > 100) {
bufferedPercent = 100 - timePercent;
}
var css = {
"left": timePercent + "%",
"width": bufferedPercent + "%"
}
if (bufferedPercent + timePercent > 99) {
event.data.buffered.addClass("done")
}
else {
event.data.buffered.removeClass("done")
}
event.data.buffered.css(css);
},
layoutControlBar: function(newWidth, newHeight){
if (this.isHTML5 && this.options.playButtonOverlay) {
this.playOverlay.fadeIn(600);
this.playOverlay.css({
"left": (newWidth / 2 - this.playOverlay.width() / 2) + "px",
"top": (newHeight / 2 - this.playOverlay.height() / 2) + "px"
});
}
$('.video-progress2').css({
"width": (newWidth - 190) + "px"
});
//$('.strobeMediaPlaybackControlBar').fadeIn(600);
$('.strobeMediaPlaybackControlBar').css({
"width": newWidth - 6 + "px"
});
}
}
StrobeMediaPlaybackChrome.prototype = methods;
/**
* jQuery plugin hook
*/
$.fn.strobemediaplaybackchrome = function(options){
var instances = [], i;
var result = this.each(function(){
instances.push(new StrobeMediaPlaybackChrome(this, options));
});
for (i = 0; i < instances.length; i++) {
instances[i].initialize();
}
return result;
};
/**
* jQuery plugin defaults
*/
$.fn.strobemediaplaybackchrome.defaults = {
controlBarMode: "docked",
controlBarAutoHide: false,
controlBarAutoHideTimeout: 10,
swf: "StrobeMediaPlayback.swf",
html5customChrome: false
};
/**
* Template function, generate using the tmpl plugin
*/
function generateHTMLCode(options){
options.data = options;
var embedHTML = chromeTemplate($, options).join("");
return embedHTML;
//return $("#template").tmpl(options);
}
function chromeTemplate(jQuery, $item){
var $ = jQuery, call, _ = [], $data = $item.data;
with ($data) {
_.push("<a class=\"smp playoverlay\"> </a> <div class=\"strobeMediaPlaybackControlBar\"> <a class=\"smp play\"> </a> <div class=\"video-progress2\"> <a href=\"#\" class=\"slider\"></a> <div class=\"video-track\"> <div class=\"played\"> </div> <div class=\"buffered\"> </div> </div> </div> <a class=\"smp fullscreen\"> </a> <a class=\"smp volume high\"> </a> <div class=\"time\"> <span class=\"currentTime\">0:00</span> / <span class=\"duration\">0:00</span> </div> </div>");
}
return _;
}
$.encode = function(text){
// Do HTML encoding replacing < > & and ' and " by corresponding entities.
return ("" + text).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'");
}
// Internals, private functions
function onMouseMove(event){
showControlBar();
}
function formatTimeStatus(currentPosition, totalDuration){
var h;
var m;
var s;
function prettyPrintSeconds(seconds, leadingMinutes, leadingHours){
seconds = Math.floor(isNaN(seconds) ? 0 : Math.max(0, seconds));
h = Math.floor(seconds / 3600);
m = Math.floor(seconds % 3600 / 60);
s = seconds % 60;
return ((h > 0 || leadingHours) ? (h + ":") : "") +
(((h > 0 || leadingMinutes) && m < 10) ? "0" : "") +
m +
":" +
(s < 10 ? "0" : "") +
s;
}
var totalDurationString = prettyPrintSeconds(totalDuration);
var currentPositionString = prettyPrintSeconds(currentPosition, h > 0 || m > 9, h > 0);
return [currentPositionString, totalDurationString];
}
})(jQuery);
/*
* Generate org.strobemediaplayback namespace - which will be used by the
* Flash/Strobe Media Playback once it is ready
*/
if (typeof org == 'undefined') {
var org = {};
}
if (typeof org.strobemediaplayback == 'undefined') {
org.strobemediaplayback = {};
}
if (typeof org.strobemediaplayback.proxied == 'undefined') {
org.strobemediaplayback.proxied = {};
}
org.strobemediaplayback.triggerHandler = function(id, eventName, updatedProperties){
org.strobemediaplayback.proxied[id].update(updatedProperties, [eventName], org.strobemediaplayback.proxied[id]);
};