diff options
Diffstat (limited to 'librevideojs/js/cliplibrejs.dev.js')
-rw-r--r-- | librevideojs/js/cliplibrejs.dev.js | 213 |
1 files changed, 4 insertions, 209 deletions
diff --git a/librevideojs/js/cliplibrejs.dev.js b/librevideojs/js/cliplibrejs.dev.js index 152b858..d779226 100644 --- a/librevideojs/js/cliplibrejs.dev.js +++ b/librevideojs/js/cliplibrejs.dev.js @@ -1,11 +1,12 @@ /*! - * @source: here! * @base: https://github.com/videojs/video.js * + * @Source: cliplibrejs.dev.js + * * @licstart The following is the entire license notice for the * JavaScript code in this page. * - * Copyleft 2016 Jesús E. Medina, Jorge Maldonado Ventura + * Copyleft 2016 Jesús Eduardo * * The JavaScript code in this page is free software: you can * redistribute it and/or modify it under the terms of the GNU @@ -5122,213 +5123,7 @@ var createGetter = function(attr){ } })(); -/* Flash Support Testing -------------------------------------------------------- */ - -librevjs.Flash.isSupported = function(){ - return librevjs.Flash.version()[0] >= 10; - // return swfobject.hasFlashPlayerVersion('10'); -}; - -librevjs.Flash.canPlaySource = function(srcObj){ - if (srcObj.type in librevjs.Flash.formats || srcObj.type in librevjs.Flash.streamingFormats) { return 'maybe'; } -}; - -librevjs.Flash.formats = { - 'video/flv': 'FLV', - 'video/x-flv': 'FLV', - 'video/mp4': 'MP4', - 'video/m4v': 'MP4' -}; - -librevjs.Flash.streamingFormats = { - 'rtmp/mp4': 'MP4', - 'rtmp/flv': 'FLV' -}; - -librevjs.Flash['onReady'] = function(currSwf){ - var el = librevjs.el(currSwf); - - // Get player from box - // On firefox reloads, el might already have a player - var player = el['player'] || el.parentNode['player'], - tech = player.tech; - - // Reference player on tech element - el['player'] = player; - - // Update reference to playback technology element - tech.el_ = el; - - librevjs.Flash.checkReady(tech); -}; - -// The SWF isn't alwasy ready when it says it is. Sometimes the API functions still need to be added to the object. -// If it's not ready, we set a timeout to check again shortly. -librevjs.Flash.checkReady = function(tech){ - - // Check if API property exists - if (tech.el().librevjs_getProperty) { - - // If so, tell tech it's ready - tech.triggerReady(); - - // Otherwise wait longer. - } else { - - setTimeout(function(){ - librevjs.Flash.checkReady(tech); - }, 50); - - } -}; - -// Trigger events from the swf on the player -librevjs.Flash['onEvent'] = function(swfID, eventName){ - var player = librevjs.el(swfID)['player']; - player.trigger(eventName); -}; - -// Log errors from the swf -librevjs.Flash['onError'] = function(swfID, err){ - var player = librevjs.el(swfID)['player']; - player.trigger('error'); - librevjs.log('Flash Error', err, swfID); -}; - -// Flash Version Check -librevjs.Flash.version = function(){ - var version = '0,0,0'; - - // IE - try { - version = new window.ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; - - // other browsers - } catch(e) { - try { - if (navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin){ - version = (navigator.plugins['Shockwave Flash 2.0'] || navigator.plugins['Shockwave Flash']).description.replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; - } - } catch(err) {} - } - return version.split(','); -}; - -// Flash embedding method. Only used in non-iframe mode -librevjs.Flash.embed = function(swf, placeHolder, flashVars, params, attributes){ - var code = librevjs.Flash.getEmbedCode(swf, flashVars, params, attributes), - - // Get element by embedding code and retrieving created element - obj = librevjs.createEl('div', { innerHTML: code }).childNodes[0], - - par = placeHolder.parentNode - ; - - placeHolder.parentNode.replaceChild(obj, placeHolder); - - // IE6 seems to have an issue where it won't initialize the swf object after injecting it. - // This is a dumb fix - var newObj = par.childNodes[0]; - setTimeout(function(){ - newObj.style.display = 'block'; - }, 1000); - - return obj; - -}; - -librevjs.Flash.getEmbedCode = function(swf, flashVars, params, attributes){ - - var objTag = '<object type="application/x-shockwave-flash"', - flashVarsString = '', - paramsString = '', - attrsString = ''; - - // Convert flash vars to string - if (flashVars) { - librevjs.obj.each(flashVars, function(key, val){ - flashVarsString += (key + '=' + val + '&'); - }); - } - - // Add swf, flashVars, and other default params - params = librevjs.obj.merge({ - 'movie': swf, - 'flashvars': flashVarsString, - 'allowScriptAccess': 'always', // Required to talk to swf - 'allowNetworking': 'all' // All should be default, but having security issues. - }, params); - - // Create param tags string - librevjs.obj.each(params, function(key, val){ - paramsString += '<param name="'+key+'" value="'+val+'" />'; - }); - - attributes = librevjs.obj.merge({ - // Add swf to attributes (need both for IE and Others to work) - 'data': swf, - - // Default to 100% width/height - 'width': '100%', - 'height': '100%' - - }, attributes); - - // Create Attributes string - librevjs.obj.each(attributes, function(key, val){ - attrsString += (key + '="' + val + '" '); - }); - - return objTag + attrsString + '>' + paramsString + '</object>'; -}; - -librevjs.Flash.streamFromParts = function(connection, stream) { - return connection + '&' + stream; -}; - -librevjs.Flash.streamToParts = function(src) { - var parts = { - connection: '', - stream: '' - }; - - if (! src) { - return parts; - } - - // Look for the normal URL separator we expect, '&'. - // If found, we split the URL into two pieces around the - // first '&'. - var connEnd = src.indexOf('&'); - var streamBegin; - if (connEnd !== -1) { - streamBegin = connEnd + 1; - } - else { - // If there's not a '&', we use the last '/' as the delimiter. - connEnd = streamBegin = src.lastIndexOf('/') + 1; - if (connEnd === 0) { - // really, there's not a '/'? - connEnd = streamBegin = src.length; - } - } - parts.connection = src.substring(0, connEnd); - parts.stream = src.substring(streamBegin, src.length); - - return parts; -}; - -librevjs.Flash.isStreamingType = function(srcType) { - return srcType in librevjs.Flash.streamingFormats; -}; - -// RTMP has four variations, any string starting -// with one of these protocols should be valid -librevjs.Flash.RTMP_RE = /^rtmp[set]?:\/\//i; - -librevjs.Flash.isStreamingSrc = function(src) { - return librevjs.Flash.RTMP_RE.test(src); -}; +/* MediaLoader REQUIRED*/ /** * @constructor */ |