var strobeMediaPlayback = function () { /*var settings = { "tablet": { "startSize": {"width":480, "height":275} }, "smartphone": { "startSize": {"width":120, "height":67} }, "default": { "startSize": {"width":480, "height":275} } };*/ //var flashvars = {}; function getSettingByDeviceType(settings, setting, deviceType, defaultValue) { if (deviceType in settings) { return (settings[deviceType][setting] ? settings[deviceType][setting] : defaultValue); } else { return (settings["default"][setting] ? settings["default"][setting] : defaultValue); } } return { /*settings: function(object) { settings = $.extend(true, settings, object); }, flashvars: function(object) { flashvars = $.extend(true, flashvars, object); },*/ draw: function(element, options, flashvars) { if (element && flashvars ) { var agent = window.location.hash.replace(/^#/, ""); var settings = $.extend(true, settings, options); //function onDeviceDetection(device) { var startSize = getSettingByDeviceType(settings, "startSize", device.getProfile().type, ""); var isDesktop = device.getProfile().type == "desktop"? true:false; var flashPlayerVersion = swfobject.getFlashPlayerVersion(); var hasFlashPlayerCapability = flashPlayerVersion.major >= 10; if (device.profileDetected() && device.useFlash() && (hasFlashPlayerCapability && flashvars.favorFlashOverHtml5Video)) { if (device.getProfile().type == "tablet" || device.getProfile().type == "smartphone"){ //flashvars.skin = "skins/"+device.getProfile().type+"-skin.xml"; flashvars.skin = "/CFIDE/scripts/ajax/resources/cf/skins/"+device.getProfile().type+"-skin.xml" flashvars.controlBarType = device.getProfile().type; flashvars.playButtonOverlay = false; } var params = settings[(device.getProfile().type in settings ? device.getProfile().type : "default")]; params["movie"] = flashvars.swf; params["allowfullscreen"] = "true"; params["allowscriptaccess"] = "always"; params["wmode"] = flashvars.wmode; var attributes = {}; $("#" + element).css("width",startSize["width"]); $("#" + element).css("height",startSize["height"]); var options = $.extend(true,options, flashvars); swfobject.embedSWF( flashvars.swf, element, startSize["width"], startSize["height"], "10.1.0", "", options, params, attributes, onFlashEmbedComplete ); } else { var html5divs; if (isDesktop) { html5divs = '
' + '' + '
'; if(flashvars["controlBarMode"] != "none") { html5divs += '
' + '
Play/Pause
' + '
0:00
' + '
' + '' + '
' + '
' + '
' + '
' + '
' + '
' + '/' + '
0:00
' + ''+ '
' + '
'+ '
Full View
' + '
'; } html5divs += '' + '
'; }else { html5divs = '
' + '
'; if(flashvars["controlBarMode"] != "none") { html5divs += '
' + '
Play/Pause
' + '
0:00
' + '
' + '' + '
' + '
' + '
' + '
' + '
' + '
' + '
0:00
' + '
Full View
' + '
' ; } html5divs += '' + '
'; } $("#" + element).html(html5divs); //$("#" + element + " .html5player").strobemediaplaybackhtml5(); } //} //new DeviceDetection(agent).addCallback(onDeviceDetection).addProfiles(profiles).detect(); } } } }();