diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc
index a46ed1a..a9428c4 100644
--- a/core/modules/file/file.field.inc
+++ b/core/modules/file/file.field.inc
@@ -403,10 +403,117 @@ function file_field_formatter_info() {
'label' => t('URL to file'),
'field types' => array('file'),
),
+ 'file_player' => array(
+ 'label' => t('Media Player'),
+ 'description' => t('Play this file within a Media Player.'),
+ 'field types' => array('file', 'text'),
+ 'settings' => array(
+ 'template' => 'default',
+ 'preload' => TRUE,
+ 'autoplay' => FALSE,
+ 'loop' => FALSE,
+ 'width' => '100%',
+ 'height' => '400px',
+ 'volume' => 80,
+ 'sources' => FALSE,
+ 'debug' => FALSE
+ )
+ )
);
}
/**
+ * Implements hook_field_formatter_settings_form
+ */
+function file_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
+ $display = $instance['display'][$view_mode];
+ $settings = $display['settings'];
+ $element = array();
+ if ($display['type'] == 'file_player') {
+
+ // Get the player information and templates.
+ $info = file_media_player_info();
+ $templates = array_keys($info['templates']);
+ $templates = array_combine($templates, $templates);
+
+ $element['template'] = array(
+ '#title' => t('Template'),
+ '#type' => 'select',
+ '#options' => $templates,
+ '#default_value' => $settings['template']
+ );
+
+ $element['preload'] = array(
+ '#title' => t('Preload'),
+ '#type' => 'checkbox',
+ '#default_value' => $settings['preload']
+ );
+
+ $element['autoplay'] = array(
+ '#title' => t('Autoplay'),
+ '#type' => 'checkbox',
+ '#default_value' => $settings['autoplay']
+ );
+
+ $element['loop'] = array(
+ '#title' => t('Loop'),
+ '#type' => 'checkbox',
+ '#default_value' => $settings['loop']
+ );
+
+ $element['width'] = array(
+ '#title' => t('Width'),
+ '#type' => 'textfield',
+ '#default_value' => $settings['width']
+ );
+
+ $element['height'] = array(
+ '#title' => t('Height'),
+ '#type' => 'textfield',
+ '#default_value' => $settings['height']
+ );
+
+ $element['volume'] = array(
+ '#title' => t('Initial Volume (0 - 100)'),
+ '#type' => 'textfield',
+ '#default_value' => $settings['volume']
+ );
+
+ $element['sources'] = array(
+ '#title' => t('Allow multiple sources'),
+ '#description' => t('Checking this will turn multiple instances of files into multiple sources within the media element.'),
+ '#type' => 'checkbox',
+ '#default_value' => $settings['sources']
+ );
+
+ $element['debug'] = array(
+ '#title' => t('Debug Mode'),
+ '#type' => 'checkbox',
+ '#default_value' => $settings['debug']
+ );
+ }
+ return $element;
+}
+
+/**
+ * Implements hook_field_formatter_settings_summary
+ */
+function file_field_formatter_settings_summary($field, $instance, $view_mode) {
+ $display = $instance['display'][$view_mode];
+ $settings = $display['settings'];
+ $summary = '';
+ if ($display['type'] == 'file_player') {
+ $header = array('Setting', 'Value');
+ $rows = array();
+ foreach ($settings as $name => $value) {
+ $rows[] = array($name, $value);
+ }
+ $summary = theme('table', array('header' => $header, 'rows' => $rows));
+ }
+ return $summary;
+}
+
+/**
* Implements hook_field_widget_info().
*/
function file_field_widget_info() {
@@ -1001,6 +1108,56 @@ function file_field_formatter_view($entity_type, $entity, $field, $instance, $la
);
}
break;
+
+ case 'file_player':
+ // Get the display settings.
+ $settings = $display['settings'];
+
+ // Get the ID for this media player.
+ $id = 'player-' . drupal_clean_css_identifier($field['field_name']);
+
+ // If they wish to show all sources within a single media element.
+ if ($settings['sources']) {
+
+ // Get the media tag.
+ $mediatag = '';
+ foreach ($items as $delta => $item) {
+ if ($mediatag = file_get_media_type((object)$item)) {
+ break;
+ }
+ }
+
+ // If the mediatag exists, then theme the player.
+ if ($mediatag) {
+ $settings['id'] = $id;
+ $element[$delta] = array(
+ '#theme' => 'media_player',
+ '#tag' => $mediatag,
+ '#attributes' => file_player_get_attributes($settings),
+ '#settings' => $settings,
+ '#sources' => $items
+ );
+ }
+ }
+ else {
+
+ // Iterate through all the items.
+ foreach ($items as $delta => $item) {
+
+ // Get the media tag.
+ if ($mediatag = file_get_media_type((object)$item)) {
+ $settings['id'] = $id . '-' . $delta;
+ $element[$delta] = array(
+ '#theme' => 'media_player',
+ '#tag' => $mediatag,
+ '#attributes' => file_player_get_attributes($settings),
+ '#settings' => $settings,
+ '#sources' => array($item)
+ );
+ }
+ }
+ }
+ break;
}
return $element;
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index c951807..2bb9841 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -85,7 +85,7 @@ function file_element_info() {
* Implements hook_theme().
*/
function file_theme() {
- return array(
+ $themes = array(
// file.module.
'file_link' => array(
'variables' => array('file' => NULL, 'icon_directory' => NULL),
@@ -110,10 +110,363 @@ function file_theme() {
'file_upload_help' => array(
'variables' => array('description' => NULL, 'upload_validators' => NULL),
),
+
+ // media player theme
+ 'media_player' => array(
+ 'render element' => 'element',
+ )
+ );
+
+ // Register the player templates
+ $info = file_get_player_info();
+ foreach ($info['templates'] as $name => $info) {
+ $themes['media_player_' . $name] = array(
+ 'template' => 'media_player_' . $name,
+ 'variables' => array('params' => NULL),
+ 'path' => $info['path']
+ );
+ }
+
+ // Return the themes.
+ return $themes;
+}
+
+/**
+ * Implements hook_library_info().
+ */
+function file_library_info() {
+ $path = drupal_get_path('module', 'file') . '/player';
+ return array(
+ 'mediaplayer' => array(
+ 'title' => 'Media Player',
+ 'version' => '0.1',
+ 'js' => array(
+ $path . '/bin/minplayer.compressed.js' => array('group' => JS_LIBRARY)
+ ),
+ 'dependencies' => array(
+ array('system', 'ui.slider')
+ )
+ ),
+ 'mediaplayer_debug' => array(
+ 'title' => 'Media Player (Debug Mode)',
+ 'version' => '0.1',
+ 'js' => array(
+ $path . '/src/minplayer.compatibility.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.flags.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.async.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.plugin.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.display.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.image.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.file.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.playLoader.base.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.players.base.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.players.html5.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.players.flash.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.players.minplayer.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.players.youtube.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.players.vimeo.js' => array('group' => JS_LIBRARY),
+ $path . '/src/minplayer.controller.base.js' => array('group' => JS_LIBRARY)
+ ),
+ 'dependencies' => array(
+ array('system', 'ui.slider')
+ )
+ )
+ );
+}
+
+/**
+ * Returns all of the media player information.
+ */
+function file_get_player_info() {
+
+ // Implement hook_media_player_info
+ $cache = cache();
+ $info = $cache->get('media_player_info');
+ if ($info) {
+ return $info->data;
+ }
+ else {
+ // Invoke all media_player_info and then set the cache.
+ $player_info = module_invoke_all('media_player_info');
+ $cache->set('media_player_info', $player_info);
+ return $player_info;
+ }
+}
+
+/**
+ * Implements hook_media_player_info
+ */
+function file_media_player_info() {
+ $path = drupal_get_path('module', 'file') . '/player/templates';
+ return array(
+ 'plugins' => array(),
+ 'templates' => array(
+ 'default' => array(
+ 'path' => $path . '/default',
+ 'js' => array(
+ $path . '/default/js/minplayer.playLoader.default.js' => array('group' => JS_DEFAULT),
+ $path . '/default/js/minplayer.controller.default.js' => array('group' => JS_DEFAULT),
+ $path . '/default/js/minplayer.default.js' => array('group' => JS_DEFAULT)
+ ),
+ 'css' => array(
+ $path . '/default/css/media_player_default.css' => array('group' => CSS_DEFAULT)
+ )
+ )
+ )
+ );
+}
+
+/**
+ * Returns the player settings.
+ */
+function file_player_settings() {
+ return array(
+ "id" => 'player',
+ "controller" => 'default',
+ "template" => 'default',
+ "swfplayer" => '',
+ "wmode" => 'transparent',
+ "preload" => true,
+ "autoplay" => false,
+ "loop" => false,
+ "width" => '100%',
+ "height" => '400px',
+ "debug" => false,
+ "volume" => 80,
+ "files" => array(),
+ "file" => '',
+ "preview" => '',
+ "attributes" => array()
);
}
/**
+ * Register a new media player in JavaScript.
+ */
+function file_register_player($settings, $attributes) {
+ $playerId = $settings['id'];
+ file_player_add_resources($settings['template'], $settings['debug']);
+ $attributes = drupal_json_encode($attributes);
+ $settings = array_intersect_key($settings, file_player_settings());
+ $settings = trim(drupal_json_encode($settings), '{}');
+ $swfplayer = url(drupal_get_path('module', 'file') . '/player/flash/minplayer.swf');
+ drupal_add_js("
+ jQuery(function() {
+ jQuery('#{$playerId}').minplayer({
+ id:'#{$playerId}',
+ attributes:{$attributes},
+ {$settings},
+ swfplayer:'{$swfplayer}'
+ });
+ });
+ ", 'inline');
+}
+
+/**
+ * Theme a media player.
+ */
+function theme_media_player($variables) {
+
+ // Get the element for this player.
+ if (isset($variables['element'])) {
+ $element = &$variables['element'];
+ }
+ else {
+ $element &$variables;
+ }
+
+ // Get the settings.
+ $settings = $element['#settings'];
+ $attributes = $element['#attributes'];
+
+ // Check to make sure there are sources.
+ if (empty($element['#sources'])) {
+ return 'No media sources provided';
+ }
+
+ // Set the value.
+ $element['#value'] = '';
+
+ // Iterate through each of the sources and create a source for that file.
+ foreach ($element['#sources'] as $delta => $file) {
+
+ // Make sure this is an object.
+ $file = (object)$file;
+
+ // Gets the source of this media.
+ if ($source = file_get_source($file)) {
+
+ // Get the source attributes.
+ $source_attributes = array('src' => $source);
+
+ // Add the sources to the #value of the media tag.
+ $element['#value'] .= theme('html_tag', array(
+ 'element' => array(
+ '#tag' => 'source',
+ '#attributes' => $source_attributes
+ )
+ ));
+ }
+ }
+
+ // Add some variables that the template needs.
+ $variables['player'] = theme('html_tag', $variables);
+ $variables['settings'] = $settings;
+
+ // Register the media player in JavaScript.
+ file_register_player($settings, $attributes);
+
+ // Return the theme for our media player.
+ return theme('media_player_' . $settings['template'], $variables);
+}
+
+/**
+ * Returns the media source provided a field.
+ *
+ * @param object A Drupal file object.
+ */
+function file_get_source($file) {
+ if ($file) {
+ if (isset($file->uri)) {
+ return file_create_url($file->uri);
+ }
+ else if (!empty($file->value)) {
+ return $file->value;
+ }
+ }
+ return '';
+}
+
+/**
+ * Returns the extension provided a file object.
+ *
+ * @param object A Drupal file object.
+ * @return string The file extension.
+ */
+function file_get_extension($file) {
+
+ // Get the file source.
+ if ($source = file_get_source($file)) {
+ return drupal_strtolower(drupal_substr($source, strrpos($source, '.') + 1));
+ }
+
+ return '';
+}
+
+/**
+ * Return the media type provided a Drupal file object.
+ *
+ * @param object A Drupal file object.
+ * @return string 'video', 'audio', or '' if none.
+ */
+function file_get_media_type($file) {
+
+ // First try the filemime.
+ if (isset($file->filemime)) {
+ if (strpos($file->filemime, 'video/') === 0) {
+ return 'video';
+ }
+ if (strpos($file->filemime, 'audio/') === 0) {
+ return 'audio';
+ }
+ }
+
+ // Next try the extension.
+ if ($ext = file_get_extension($file)) {
+
+ // Determine if the extension is a "video" type.
+ if (in_array($ext, array('swf', 'mov', 'mp4', 'm4v', 'flv', 'f4v', 'ogg', 'ogv', '3g2', 'webm'))) {
+ return 'video';
+ }
+
+ // Determine if the extension is an "audio" type.
+ if (in_array($ext, array('mp3', 'oga', 'wav', 'aif', 'm4a', 'aac'))) {
+ return 'audio';
+ }
+ }
+
+ // Return video if value is set, nothing otherwise.
+ return !empty($file->value) ? 'video' : '';
+}
+
+/**
+ * Returns the settings for this video or audio element.
+ */
+function file_player_get_attributes($settings) {
+ $attributes = array();
+ $element_settings = array('preload', 'autoplay', 'loop');
+ foreach ($settings as $name => $value) {
+ if ($value && in_array($name, $element_settings)) {
+ $attributes[$name] = NULL;
+ }
+ }
+
+ // Set the ID, width and height.
+ $attributes['id'] = $settings['id'] . '-player';
+ $attributes['width'] = '100%';
+ $attributes['height'] = '100%';
+ return $attributes;
+}
+
+/**
+ * Adds the media player resources to the view.
+ */
+function file_player_add_resources($template, $debug) {
+ static $resources_added = FALSE, $template_added = array();
+
+ // Get the player information.
+ $info = file_media_player_info();
+
+ if (!$resources_added) {
+
+ // Add the media player library.
+ drupal_add_library('file', $debug ? 'mediaplayer_debug' : 'mediaplayer');
+
+ // Iterate through all the plugins...
+ foreach ($info['plugins'] as $plugin) {
+
+ // Include all of the css and js files.
+ if ($plugin['js']) {
+ foreach ($plugin['js'] as $file => $options) {
+ drupal_add_js($file, $options);
+ }
+ }
+ if ($plugin['css']) {
+ foreach ($plugin['css'] as $file => $options) {
+ drupal_add_css($file, $options);
+ }
+ }
+ }
+ }
+
+ // Get the templates...
+ $templates = $info['templates'];
+
+ // If this template exists, then...
+ if (!isset($template_added[$template]) && isset($templates[$template])) {
+
+ // Statically cache this so we won't add it again.
+ $template_added[$template] = TRUE;
+
+ // Store the template info.
+ $template = $templates[$template];
+
+ // Include all of the template files.
+ if ($template['js']) {
+ foreach ($template['js'] as $file => $options) {
+ drupal_add_js($file, $options);
+ }
+ }
+ if ($template['css']) {
+ foreach ($template['css'] as $file => $options) {
+ drupal_add_css($file, $options);
+ }
+ }
+ }
+}
+
+/**
* Implements hook_file_download().
*
* This function takes an extra parameter $field_type so that it may
diff --git a/core/modules/file/player/README.md b/core/modules/file/player/README.md
new file mode 100644
index 0000000..e860146
--- /dev/null
+++ b/core/modules/file/player/README.md
@@ -0,0 +1,124 @@
+minPlayer - Because less IS more.
+===================================
+
+The goal of this project is to provide a slim, well documented, object oriented,
+plugin-based "core" media player in which other players and libraries can build
+on top of. It is written using object oriented JavaScript and is continuously
+integrated using JSLint, JSDoc, and Google Closure.
+
+Multiple players - One single API.
+-----------------------------------
+It also allows for hot-swappable 3rd party API players by providing a common
+API for all of these players so that they can be utilized in the same manner.
+This means that once you develop for the minPlayer, one can easily bring in a
+different player an your code will still function as it would for all the
+others. Out of the box, this player provides a common API for YouTube, Vimeo,
+HTML5, and Flash with more on the way.
+
+Everything is a plugin
+-----------------------------------
+Since this is a plugin-based media player, every displayable class must derive
+from the plugin class, thereby, making it a plugin. This includes the media
+player itself. This plugin system is highly flexible to be able to handle
+just about any type of plugin imaginable, and allows for every plugin to have
+direct dependeny-injected control over any other plugin within the media player.
+
+Complete User Interface & Business Logic separation
+-----------------------------------
+One common complaint for many media solutions out there is that they hijack the
+DOM and build out their own controls to provide consistency amongst different
+browsers. They do this, however, within the core player which completely binds
+the user interface to the business logic of the media player. The minPlayer
+takes a different approach by keeping ALL user interface functionality within
+the "templates" directory, where each template essentially derives from the base
+Business logic classes only to provide the user interface aspects of that control.
+This allows for easy templating of the media player besides just overriding the
+CSS like current media solutions do today.
+
+No "Features"!
+-----------------------------------
+I am pleased to say that this media player does NOT have many features, and this
+is on purpose. Since this is a "core" player, it does not have any features
+other than what is critical in presenting your media. Any additional "bling"
+will be added to this player from different repositories and from different
+players that extend this "core" functionality. This methodology will keep this
+"core" media solution lean & highly functional.
+
+API
+-----------------------------------
+The API for minPlayer is very simple. It revolves around a single API that is
+able to retrieve any plugin even before that plugin is created. By doing this,
+you can have complete control over any plugin within the minPlayer. This API
+is simply called
+
+```
+minplayer.get();
+```
+
+This API can take up to three different argument with each argument providing
+different usage. The code docs for this function are as follows...
+
+```
+/**
+ * The main API for minPlayer.
+ *
+ * Provided that this function takes three parameters, there are 8 different
+ * ways to use this api.
+ *
+ * id (0x100) - You want a specific player.
+ * plugin (0x010) - You want a specific plugin.
+ * callback (0x001) - You only want it when it is ready.
+ *
+ * 000 - You want all plugins from all players, ready or not.
+ *
+ * var instances = minplayer.get();
+ *
+ * 001 - You want all plugins from all players, but only when ready.
+ *
+ * minplayer.get(function(plugin) {
+ * // Code goes here.
+ * });
+ *
+ * 010 - You want a specific plugin from all players, ready or not...
+ *
+ * var medias = minplayer.get(null, 'media');
+ *
+ * 011 - You want a specific plugin from all players, but only when ready.
+ *
+ * minplayer.get('player', function(player) {
+ * // Code goes here.
+ * });
+ *
+ * 100 - You want all plugins from a specific player, ready or not.
+ *
+ * var plugins = minplayer.get('player_id');
+ *
+ * 101 - You want all plugins from a specific player, but only when ready.
+ *
+ * minplayer.get('player_id', null, function(plugin) {
+ * // Code goes here.
+ * });
+ *
+ * 110 - You want a specific plugin from a specific player, ready or not.
+ *
+ * var plugin = minplayer.get('player_id', 'media');
+ *
+ * 111 - You want a specific plugin from a specific player, only when ready.
+ *
+ * minplayer.get('player_id', 'media', function(media) {
+ * // Code goes here.
+ * });
+ *
+ * @this The context in which this function was called.
+ * @param {string} id The ID of the widget to get the plugins from.
+ * @param {string} plugin The name of the plugin.
+ * @param {function} callback Called when the plugin is ready.
+ * @return {object} The plugin object if it is immediately available.
+ */
+minplayer.get = function(id, plugin, callback) {
+};
+```
+
+Thanks and enjoy minPlayer.
+
+
diff --git a/core/modules/file/player/bin/minplayer.compressed.js b/core/modules/file/player/bin/minplayer.compressed.js
new file mode 100644
index 0000000..7b70e43
--- /dev/null
+++ b/core/modules/file/player/bin/minplayer.compressed.js
@@ -0,0 +1,95 @@
+var minplayer=minplayer||{};function checkPlayType(a,b){if("function"===typeof a.canPlayType){if("object"===typeof b){for(var c=b.length,d="";c--&&!(d=checkPlayType(a,b[c])););return d}c=a.canPlayType(b);if("no"!==c&&""!==c)return b}return""}
+minplayer.compatibility=function(){var a=null,a=document.createElement("video");this.videoOGG=checkPlayType(a,"video/ogg");this.videoH264=checkPlayType(a,["video/mp4","video/h264"]);this.videoWEBM=checkPlayType(a,["video/x-webm","video/webm","application/octet-stream"]);a=document.createElement("audio");this.audioOGG=checkPlayType(a,"audio/ogg");this.audioMP3=checkPlayType(a,"audio/mpeg");this.audioMP4=checkPlayType(a,"audio/mp4")};minplayer.playTypes||(minplayer.playTypes=new minplayer.compatibility);
+minplayer=minplayer||{};minplayer.async=function(){this.value=null;this.queue=[]};minplayer.async.prototype.get=function(a){null!==this.value?a(this.value):this.queue.push(a)};minplayer.async.prototype.set=function(a){this.value=a;var b=this.queue.length;if(b){for(;b--;)this.queue[b](a);this.queue=[]}};minplayer=minplayer||{};minplayer.flags=function(){this.flag=0;this.ids={};this.numFlags=0};
+minplayer.flags.prototype.setFlag=function(a,b){this.ids.hasOwnProperty(a)||(this.ids[a]=this.numFlags,this.numFlags++);this.flag=b?this.flag|1<a?(c.height=b.height,c.width=Math.floor(b.height*a)):(c.height=Math.floor(b.width/a),c.width=b.width),c.x=Math.floor((b.width-c.width)/2),c.y=Math.floor((b.height-c.height)/2));return c};minplayer.display.prototype.getElements=function(){return{}};minplayer.display.prototype.isValid=function(){return 0b&&(a=d,b=f)});return a};
+minplayer.file.prototype.getPriority=function(){var a=1;this.player&&(a=minplayer.players[this.player].getPriority());switch(this.mimetype){case "video/x-webm":case "video/webm":case "application/octet-stream":return 10*a;case "video/mp4":case "audio/mp4":case "audio/mpeg":return 9*a;case "video/ogg":case "audio/ogg":case "video/quicktime":return 8*a;default:return 5*a}};minplayer.file.prototype.getFileExtension=function(){return this.path.substring(this.path.lastIndexOf(".")+1).toLowerCase()};
+minplayer.file.prototype.getMimeType=function(){switch(this.extension){case "mp4":case "m4v":case "flv":case "f4v":return"video/mp4";case "webm":return"video/webm";case "ogg":case "ogv":return"video/ogg";case "3g2":return"video/3gpp2";case "3gpp":case "3gp":return"video/3gpp";case "mov":return"video/quicktime";case "swf":return"application/x-shockwave-flash";case "oga":return"audio/ogg";case "mp3":return"audio/mpeg";case "m4a":case "f4a":return"audio/mp4";case "aac":return"audio/aac";case "wav":return"audio/vnd.wave";
+case "wma":return"audio/x-ms-wma";default:return"unknown"}};minplayer.file.prototype.getType=function(){switch(this.mimetype){case "video/mp4":case "video/webm":case "application/octet-stream":case "video/x-webm":case "video/ogg":case "video/3gpp2":case "video/3gpp":case "video/quicktime":return"video";case "audio/mp3":case "audio/mp4":case "audio/ogg":case "audio/mpeg":return"audio";default:return""}};
+minplayer.file.prototype.getId=function(){var a=minplayer.players[this.player];return a&&a.getMediaId?a.getMediaId(this):""};minplayer=minplayer||{};minplayer.playLoader=minplayer.playLoader||{};minplayer.playLoader.base=function(a,b){this.busy=new minplayer.flags;this.bigPlay=new minplayer.flags;this.preview=null;minplayer.display.call(this,"playLoader",a,b)};minplayer.playLoader.base.prototype=new minplayer.display;minplayer.playLoader.base.prototype.constructor=minplayer.playLoader.base;
+minplayer.playLoader.base.prototype.construct=function(){minplayer.display.prototype.construct.call(this);this.get("media",function(a){a.hasPlayLoader()?(this.elements.busy&&this.elements.busy.unbind().hide(),this.elements.bigPlay&&this.elements.bigPlay.unbind().hide(),this.display.unbind().hide()):(this.loadPreview(),this.elements.bigPlay&&this.elements.bigPlay.unbind().bind("click",function(b){b.preventDefault();jQuery(this).hide();a.play()}),a.unbind("loadstart").bind("loadstart",{obj:this},function(a){a.data.obj.busy.setFlag("media",
+!0);a.data.obj.bigPlay.setFlag("media",!0);a.data.obj.preview&&a.data.obj.elements.preview.show();a.data.obj.checkVisibility()}),a.bind("waiting",{obj:this},function(a){a.data.obj.busy.setFlag("media",!0);a.data.obj.checkVisibility()}),a.bind("loadeddata",{obj:this},function(a){a.data.obj.busy.setFlag("media",!1);a.data.obj.checkVisibility()}),a.bind("playing",{obj:this},function(a){a.data.obj.busy.setFlag("media",!1);a.data.obj.bigPlay.setFlag("media",!1);a.data.obj.preview&&a.data.obj.elements.preview.hide();
+a.data.obj.checkVisibility()}),a.bind("pause",{obj:this},function(a){a.data.obj.bigPlay.setFlag("media",!0);a.data.obj.checkVisibility()}))});this.ready()};
+minplayer.playLoader.base.prototype.loadPreview=function(){this.elements.preview&&(this.options.preview||(this.options.preview=this.elements.media.attr("poster")),this.elements.media.attr("poster",""),this.options.preview?(this.elements.preview.addClass("has-preview").show(),this.preview=new minplayer.image(this.elements.preview,this.options),this.preview.load(this.options.preview)):this.elements.preview.hide())};
+minplayer.playLoader.base.prototype.checkVisibility=function(){this.busy.flag?this.elements.busy.show():this.elements.busy.hide();this.bigPlay.flag?this.elements.bigPlay.show():this.elements.bigPlay.hide();(this.bigPlay.flag||this.busy.flag)&&this.display.show();!this.bigPlay.flag&&!this.busy.flag&&this.display.hide()};minplayer=minplayer||{};minplayer.players=minplayer.players||{};minplayer.players.base=function(a,b){minplayer.display.call(this,"media",a,b)};minplayer.players.base.prototype=new minplayer.display;
+minplayer.players.base.prototype.constructor=minplayer.players.base;minplayer.players.base.getPriority=function(){return 0};minplayer.players.base.getMediaId=function(){return""};minplayer.players.base.canPlay=function(){return!1};
+minplayer.players.base.prototype.construct=function(){minplayer.display.prototype.construct.call(this);this.reset();this.mediaFile=this.options.file;this.playerFound()||(this.elements.media&&this.elements.media.remove(),this.display.html(this.create()));this.player=this.getPlayer();var a=this;jQuery(document).bind("click",function(b){a.hasFocus=0==jQuery(b.target).closest("#"+a.options.id).length?!1:!0});jQuery(document).bind("keydown",{obj:this},function(a){if(a.data.obj.hasFocus)switch(a.preventDefault(),
+a.keyCode){case 32:case 179:a.data.obj.playing?a.data.obj.pause():a.data.obj.play();break;case 38:a.data.obj.setVolumeRelative(0.1);break;case 40:a.data.obj.setVolumeRelative(-0.1);break;case 37:case 227:a.data.obj.seekRelative(-0.05);break;case 39:case 228:a.data.obj.seekRelative(0.05)}})};minplayer.players.base.prototype.destroy=function(){minplayer.plugin.prototype.destroy.call(this);this.reset()};
+minplayer.players.base.prototype.reset=function(){this.playerReady=!1;this.duration=new minplayer.async;this.currentTime=new minplayer.async;this.bytesLoaded=new minplayer.async;this.bytesTotal=new minplayer.async;this.bytesStart=new minplayer.async;this.volume=new minplayer.async;this.loading=this.playing=this.hasFocus=!1;this.player&&jQuery(this.player).unbind()};minplayer.players.base.prototype.poll=function(a){var b=this;setTimeout(function d(){a.call(b)&&setTimeout(d,1E3)},1E3)};
+minplayer.players.base.prototype.onReady=function(){var a=this;this.playerReady=!0;this.setVolume(this.options.volume/100);this.loading=!0;this.poll(function(){a.loading&&a.getBytesLoaded(function(b){a.getBytesTotal(function(c){if(b||c){var d=0;a.getBytesStart(function(a){d=a});a.trigger("progress",{loaded:b,total:c,start:d});b>=c&&(a.loading=!1)}})});return a.loading});this.ready();this.trigger("loadstart")};
+minplayer.players.base.prototype.onPlaying=function(){var a=this;this.trigger("playing");this.playing=this.hasFocus=!0;this.poll(function(){a.playing&&a.getCurrentTime(function(b){a.getDuration(function(c){b=parseFloat(b);c=parseFloat(c);(b||c)&&a.trigger("timeupdate",{currentTime:b,duration:c})})});return a.playing})};minplayer.players.base.prototype.onPaused=function(){this.trigger("pause");this.playing=this.hasFocus=!1};
+minplayer.players.base.prototype.onComplete=function(){this.hasFocus=this.loading=this.playing=!1;this.trigger("ended")};minplayer.players.base.prototype.onLoaded=function(){this.trigger("loadeddata")};minplayer.players.base.prototype.onWaiting=function(){this.trigger("waiting")};minplayer.players.base.prototype.onError=function(a){this.hasFocus=!1;this.trigger("error",a)};minplayer.players.base.prototype.isReady=function(){return this.player&&this.playerReady};
+minplayer.players.base.prototype.hasPlayLoader=function(){return!1};minplayer.players.base.prototype.playerFound=function(){return!1};minplayer.players.base.prototype.create=function(){this.reset();return null};minplayer.players.base.prototype.getPlayer=function(){return this.player};minplayer.players.base.prototype.load=function(a){a&&(this.reset(),this.mediaFile=a)};minplayer.players.base.prototype.play=function(){};minplayer.players.base.prototype.pause=function(){};
+minplayer.players.base.prototype.stop=function(){this.hasFocus=this.loading=this.playing=!1};minplayer.players.base.prototype.seekRelative=function(a){var b=this;this.getCurrentTime(function(c){b.getDuration(function(d){if(d){var e=0,e=-1a?c/d+parseFloat(a):(c+parseFloat(a))/d;b.seek(e)}})})};minplayer.players.base.prototype.seek=function(){};minplayer.players.base.prototype.setVolumeRelative=function(a){var b=this;this.getVolume(function(c){c+=parseFloat(a);c=0>c?0:c;b.setVolume(1':">");this.options.elements.media.attr("src","").empty().html(b)}minplayer.players.base.prototype.load.call(this,a)};minplayer.players.html5.prototype.play=function(){minplayer.players.base.prototype.play.call(this);this.isReady()&&this.player.play()};
+minplayer.players.html5.prototype.pause=function(){minplayer.players.base.prototype.pause.call(this);this.isReady()&&this.player.pause()};minplayer.players.html5.prototype.stop=function(){minplayer.players.base.prototype.stop.call(this);this.isReady()&&(this.player.pause(),this.player.src="")};minplayer.players.html5.prototype.seek=function(a){minplayer.players.base.prototype.seek.call(this,a);this.isReady()&&(this.player.currentTime=a)};
+minplayer.players.html5.prototype.setVolume=function(a){minplayer.players.base.prototype.setVolume.call(this,a);this.isReady()&&(this.player.volume=a)};minplayer.players.html5.prototype.getVolume=function(a){this.isReady()&&a(this.player.volume)};minplayer.players.html5.prototype.getDuration=function(a){this.isReady()&&a(this.player.duration)};minplayer.players.html5.prototype.getCurrentTime=function(a){this.isReady()&&a(this.player.currentTime)};
+minplayer.players.html5.prototype.getBytesLoaded=function(a){if(this.isReady()){var b=0;this.bytesLoaded.value?b=this.bytesLoaded.value:this.player.buffered&&0 ';d=d+' '+
+(' ');d+=' ';d=d+' '+(' ')+(' '};minplayer.players.flash.prototype.playerFound=function(){return 0
+ * Usage:
+ *
+ * var playTypes = new minplayer.compatibility();
+ *
+ * if (playTypes.videoOGG) {
+ * console.log("This browser can play OGG video");
+ * }
+ *
+ * if (playTypes.videoH264) {
+ * console.log("This browser can play H264 video");
+ * }
+ *
+ * if (playTypes.videoWEBM) {
+ * console.log("This browser can play WebM video");
+ * }
+ *
+ * if (playTypes.audioOGG) {
+ * console.log("This browser can play OGG audio");
+ * }
+ *
+ * if (playTypes.audioMP3) {
+ * console.log("This browser can play MP3 audio");
+ * }
+ *
+ * if (playTypes.audioMP4) {
+ * console.log("This browser can play MP4 audio");
+ * }
+ *
+ */
+minplayer.compatibility = function() {
+ var elem = null;
+
+ // Create a video element.
+ elem = document.createElement('video');
+
+ /** Can play OGG video */
+ this.videoOGG = checkPlayType(elem, 'video/ogg');
+
+ /** Can play H264 video */
+ this.videoH264 = checkPlayType(elem, [
+ 'video/mp4',
+ 'video/h264'
+ ]);
+
+ /** Can play WEBM video */
+ this.videoWEBM = checkPlayType(elem, [
+ 'video/x-webm',
+ 'video/webm',
+ 'application/octet-stream'
+ ]);
+
+ // Create an audio element.
+ elem = document.createElement('audio');
+
+ /** Can play audio OGG */
+ this.audioOGG = checkPlayType(elem, 'audio/ogg');
+
+ /** Can play audio MP3 */
+ this.audioMP3 = checkPlayType(elem, 'audio/mpeg');
+
+ /** Can play audio MP4 */
+ this.audioMP4 = checkPlayType(elem, 'audio/mp4');
+};
+
+if (!minplayer.playTypes) {
+
+ /** The compatible playtypes for this browser. */
+ minplayer.playTypes = new minplayer.compatibility();
+}
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/**
+ * @constructor
+ * @class This class keeps track of asynchronous get requests for certain
+ * variables within the player.
+ */
+minplayer.async = function() {
+
+ /** The final value of this asynchronous variable. */
+ this.value = null;
+
+ /** The queue of callbacks to call when this value is determined. */
+ this.queue = [];
+};
+
+/**
+ * Retrieve the value of this variable.
+ *
+ * @param {function} callback The function to call when the value is determined.
+ * @param {function} pollValue The poll function to try and get the value every
+ * 1 second if the value is not set.
+ */
+minplayer.async.prototype.get = function(callback, pollValue) {
+
+ // If the value is set, then immediately call the callback, otherwise, just
+ // add it to the queue when the variable is set.
+ if (this.value !== null) {
+ callback(this.value);
+ }
+ else {
+
+ // Add this callback to the queue.
+ this.queue.push(callback);
+ }
+};
+
+/**
+ * Sets the value of an asynchronous value.
+ *
+ * @param {void} val The value to set.
+ */
+minplayer.async.prototype.set = function(val) {
+
+ // Set the value.
+ this.value = val;
+
+ // Get the callback queue length.
+ var i = this.queue.length;
+
+ // Iterate through all the callbacks and call them.
+ if (i) {
+ while (i--) {
+ this.queue[i](val);
+ }
+
+ // Reset the queue.
+ this.queue = [];
+ }
+};
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/**
+ * @constructor
+ * @class This is a class used to keep track of flag states
+ * which is used to control the busy cursor, big play button, among other
+ * items in which multiple components can have an interest in hiding or
+ * showing a single element on the screen.
+ *
+ *
+ * Usage:
+ *
+ * // Declare a flags variable.
+ * var flags = new minplayer.flags();
+ *
+ * // Set the flag based on two components interested in the flag.
+ * flags.setFlag("component1", true);
+ * flags.setFlag("component2", true);
+ *
+ * // Print out the value of the flags. ( Prints 3 )
+ * console.log(flags.flags);
+ *
+ * // Now unset a single components flag.
+ * flags.setFlag("component1", false);
+ *
+ * // Print out the value of the flags.
+ * console.log(flags.flags);
+ *
+ * // Unset the other components flag.
+ * flags.setFlag("component2", false);
+ *
+ * // Print out the value of the flags.
+ * console.log(flags.flags);
+ *
+ *
+ */
+minplayer.flags = function() {
+
+ /** The flag. */
+ this.flag = 0;
+
+ /** Id map to reference id with the flag index. */
+ this.ids = {};
+
+ /** The number of flags. */
+ this.numFlags = 0;
+};
+
+/**
+ * Sets a flag based on boolean logic operators.
+ *
+ * @param {string} id The id of the controller interested in this flag.
+ * @param {boolean} value The value of this flag ( true or false ).
+ */
+minplayer.flags.prototype.setFlag = function(id, value) {
+
+ // Define this id if it isn't present.
+ if (!this.ids.hasOwnProperty(id)) {
+ this.ids[id] = this.numFlags;
+ this.numFlags++;
+ }
+
+ // Use binary operations to keep track of the flag state
+ if (value) {
+ this.flag |= (1 << this.ids[id]);
+ }
+ else {
+ this.flag &= ~(1 << this.ids[id]);
+ }
+};
+/** The minplayer namespace. */
+minplayer = minplayer || {};
+
+/** Static array to keep track of all plugins. */
+minplayer.plugins = minplayer.plugins || {};
+
+/** Static array to keep track of queues. */
+minplayer.queue = minplayer.queue || [];
+
+/** Mutex lock to keep multiple triggers from occuring. */
+minplayer.lock = false;
+
+/**
+ * @constructor
+ * @class The base class for all plugins.
+ *
+ * @param {string} name The name of this plugin.
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.plugin = function(name, context, options) {
+
+ /** The name of this plugin. */
+ this.name = name;
+
+ /** The ready flag. */
+ this.pluginReady = false;
+
+ /** The options for this plugin. */
+ this.options = options;
+
+ /** The event queue. */
+ this.queue = {};
+
+ /** Keep track of already triggered events. */
+ this.triggered = {};
+
+ /** Create a queue lock. */
+ this.lock = false;
+
+ // Only call the constructor if we have a context.
+ if (context) {
+
+ // Construct this plugin.
+ this.construct();
+ }
+};
+
+/**
+ * The constructor which is called once the context is set.
+ * Any class deriving from the plugin class should place all context
+ * dependant functionality within this function instead of the standard
+ * constructor function since it is called on object derivation as well
+ * as object creation.
+ */
+minplayer.plugin.prototype.construct = function() {
+
+ // Adds this as a plugin.
+ this.addPlugin();
+};
+
+/**
+ * Destructor.
+ */
+minplayer.plugin.prototype.destroy = function() {
+
+ // Unbind all events.
+ this.unbind();
+};
+
+/**
+ * Loads all of the available plugins.
+ */
+minplayer.plugin.prototype.loadPlugins = function() {
+
+ // Get all the plugins to load.
+ var instance = '';
+
+ // Iterate through all the plugins.
+ for (var name in this.options.plugins) {
+
+ // Only load if it does not already exist.
+ if (!minplayer.plugins[this.options.id][name]) {
+
+ // Get the instance name from the setting.
+ instance = this.options.plugins[name];
+
+ // If this object exists.
+ if (minplayer[name][instance]) {
+
+ // Declare a new object.
+ new minplayer[name][instance](this.display, this.options);
+ }
+ }
+ }
+};
+
+/**
+ * Plugins should call this method when they are ready.
+ */
+minplayer.plugin.prototype.ready = function() {
+
+ // Keep this plugin from triggering multiple ready events.
+ if (!this.pluginReady) {
+
+ // Set the ready flag.
+ this.pluginReady = true;
+
+ // Now trigger that I am ready.
+ this.trigger('ready');
+
+ // Check the queue.
+ this.checkQueue();
+ }
+};
+
+/**
+ * Adds a new plugin to this player.
+ *
+ * @param {string} name The name of this plugin.
+ * @param {object} plugin A new plugin object, derived from media.plugin.
+ */
+minplayer.plugin.prototype.addPlugin = function(name, plugin) {
+ name = name || this.name;
+ plugin = plugin || this;
+
+ // Make sure the plugin is valid.
+ if (plugin.isValid()) {
+
+ // If the plugins for this instance do not exist.
+ if (!minplayer.plugins[this.options.id]) {
+
+ // Initialize the plugins.
+ minplayer.plugins[this.options.id] = {};
+ }
+
+ // Add this plugin.
+ minplayer.plugins[this.options.id][name] = plugin;
+ }
+};
+
+/**
+ * Gets a plugin by name and calls callback when it is ready.
+ *
+ * @param {string} plugin The plugin of the plugin.
+ * @param {function} callback Called when the plugin is ready.
+ * @return {object} The plugin if no callback is provided.
+ */
+minplayer.plugin.prototype.get = function(plugin, callback) {
+
+ // If they pass just a callback, then return all plugins when ready.
+ if (typeof plugin === 'function') {
+ callback = plugin;
+ plugin = null;
+ }
+
+ // Return the minplayer.get equivalent.
+ return minplayer.get.call(this, this.options.id, plugin, callback);
+};
+
+/**
+ * Check the queue and execute it.
+ */
+minplayer.plugin.prototype.checkQueue = function() {
+
+ // Initialize our variables.
+ var q = null, i = 0, check = false, newqueue = [];
+
+ // Set the lock.
+ minplayer.lock = true;
+
+ // Iterate through all the queues.
+ var length = minplayer.queue.length;
+ for (i = 0; i < length; i++) {
+
+ // Get the queue.
+ q = minplayer.queue[i];
+
+ // Now check to see if this queue is about us.
+ check = !q.id && !q.plugin;
+ check |= (q.plugin == this.name) && (!q.id || (q.id == this.options.id));
+
+ // If the check passes...
+ if (check) {
+ check = minplayer.bind.call(
+ q.context,
+ q.event,
+ this.options.id,
+ this.name,
+ q.callback
+ );
+ }
+
+ // Add the queue back if it doesn't check out.
+ if (!check) {
+
+ // Add this back to the queue.
+ newqueue.push(q);
+ }
+ }
+
+ // Set the old queue to the new queue.
+ minplayer.queue = newqueue;
+
+ // Release the lock.
+ minplayer.lock = false;
+};
+
+/**
+ * Trigger a media event.
+ *
+ * @param {string} type The event type.
+ * @param {object} data The event data object.
+ * @return {object} The plugin object.
+ */
+minplayer.plugin.prototype.trigger = function(type, data) {
+ data = data || {};
+ data.plugin = this;
+
+ // Add this to our triggered array.
+ this.triggered[type] = data;
+
+ // Check to make sure the queue for this type exists.
+ if (this.queue[type]) {
+
+ var i = 0, queue = {};
+
+ // Iterate through all the callbacks in this queue.
+ for (i in this.queue[type]) {
+
+ // Setup the event object, and call the callback.
+ queue = this.queue[type][i];
+ queue.callback({target: this, data: queue.data}, data);
+ }
+ }
+
+ // Return the plugin object.
+ return this;
+};
+
+/**
+ * Bind to a media event.
+ *
+ * @param {string} type The event type.
+ * @param {object} data The data to bind with the event.
+ * @param {function} fn The callback function.
+ * @return {object} The plugin object.
+ **/
+minplayer.plugin.prototype.bind = function(type, data, fn) {
+
+ // Allow the data to be the callback.
+ if (typeof data === 'function') {
+ fn = data;
+ data = null;
+ }
+
+ // You must bind to a specific event and have a callback.
+ if (!type || !fn) {
+ return;
+ }
+
+ // Initialize the queue for this type.
+ this.queue[type] = this.queue[type] || [];
+
+ // Unbind any existing equivalent events.
+ this.unbind(type, fn);
+
+ // Now add this event to the queue.
+ this.queue[type].push({
+ callback: fn,
+ data: data
+ });
+
+ // Now see if this event has already been triggered.
+ if (this.triggered[type]) {
+
+ // Go ahead and trigger the event.
+ fn({target: this, data: data}, this.triggered[type]);
+ }
+
+ // Return the plugin.
+ return this;
+};
+
+/**
+ * Unbind a media event.
+ *
+ * @param {string} type The event type.
+ * @param {function} fn The callback function.
+ * @return {object} The plugin object.
+ **/
+minplayer.plugin.prototype.unbind = function(type, fn) {
+
+ // If this is locked then try again after 10ms.
+ if (this.lock) {
+ var _this = this;
+ setTimeout(function() {
+ _this.unbind(type, fn);
+ }, 10);
+ }
+
+ // Set the lock.
+ this.lock = true;
+
+ if (!type) {
+ this.queue = {};
+ }
+ else if (!fn) {
+ this.queue[type] = [];
+ }
+ else {
+ // Iterate through all the callbacks and search for equal callbacks.
+ var i = 0, queue = {};
+ for (i in this.queue[type]) {
+ if (this.queue[type][i].callback === fn) {
+ queue = this.queue[type].splice(1, 1);
+ delete queue;
+ }
+ }
+ }
+
+ // Reset the lock.
+ this.lock = false;
+
+ // Return the plugin.
+ return this;
+};
+
+/**
+ * Adds an item to the queue.
+ *
+ * @param {object} context The context which this is called within.
+ * @param {string} event The event to trigger on.
+ * @param {string} id The player ID.
+ * @param {string} plugin The name of the plugin.
+ * @param {function} callback Called when the event occurs.
+ */
+minplayer.addQueue = function(context, event, id, plugin, callback) {
+
+ // See if it is locked...
+ if (!minplayer.lock) {
+ minplayer.queue.push({
+ context: context,
+ id: id,
+ event: event,
+ plugin: plugin,
+ callback: callback
+ });
+ }
+ else {
+
+ // If so, then try again after 10 milliseconds.
+ setTimeout(function() {
+ minplayer.addQueue(context, id, event, plugin, callback);
+ }, 10);
+ }
+};
+
+/**
+ * Binds an event to a plugin instance, and if it doesn't exist, then caches
+ * it for a later time.
+ *
+ * @param {string} event The event to trigger on.
+ * @param {string} id The player ID.
+ * @param {string} plugin The name of the plugin.
+ * @param {function} callback Called when the event occurs.
+ * @return {boolean} If the bind was successful.
+ * @this The object in context who called this method.
+ */
+minplayer.bind = function(event, id, plugin, callback) {
+
+ // If no callback exists, then just return false.
+ if (!callback) {
+ return false;
+ }
+
+ // Get the plugins.
+ var inst = minplayer.plugins;
+
+ // See if this plugin exists.
+ if (inst[id][plugin]) {
+
+ // If so, then bind the event to this plugin.
+ inst[id][plugin].bind(event, {context: this}, function(event, data) {
+ callback.call(event.data.context, data.plugin);
+ });
+ return true;
+ }
+
+ // If not, then add it to the queue to bind later.
+ minplayer.addQueue(this, event, id, plugin, callback);
+
+ // Return that this wasn't handled.
+ return false;
+};
+
+/**
+ * The main API for minPlayer.
+ *
+ * Provided that this function takes three parameters, there are 8 different
+ * ways to use this api.
+ *
+ * id (0x100) - You want a specific player.
+ * plugin (0x010) - You want a specific plugin.
+ * callback (0x001) - You only want it when it is ready.
+ *
+ * 000 - You want all plugins from all players, ready or not.
+ *
+ * var plugins = minplayer.get();
+ *
+ * 001 - You want all plugins from all players, but only when ready.
+ *
+ * minplayer.get(function(plugin) {
+ * // Code goes here.
+ * });
+ *
+ * 010 - You want a specific plugin from all players, ready or not...
+ *
+ * var medias = minplayer.get(null, 'media');
+ *
+ * 011 - You want a specific plugin from all players, but only when ready.
+ *
+ * minplayer.get('player', function(player) {
+ * // Code goes here.
+ * });
+ *
+ * 100 - You want all plugins from a specific player, ready or not.
+ *
+ * var plugins = minplayer.get('player_id');
+ *
+ * 101 - You want all plugins from a specific player, but only when ready.
+ *
+ * minplayer.get('player_id', null, function(plugin) {
+ * // Code goes here.
+ * });
+ *
+ * 110 - You want a specific plugin from a specific player, ready or not.
+ *
+ * var plugin = minplayer.get('player_id', 'media');
+ *
+ * 111 - You want a specific plugin from a specific player, only when ready.
+ *
+ * minplayer.get('player_id', 'media', function(media) {
+ * // Code goes here.
+ * });
+ *
+ * @this The context in which this function was called.
+ * @param {string} id The ID of the widget to get the plugins from.
+ * @param {string} plugin The name of the plugin.
+ * @param {function} callback Called when the plugin is ready.
+ * @return {object} The plugin object if it is immediately available.
+ */
+minplayer.get = function(id, plugin, callback) {
+
+ // Normalize the arguments for a better interface.
+ if (typeof id === 'function') {
+ callback = id;
+ plugin = id = null;
+ }
+
+ if (typeof plugin === 'function') {
+ callback = plugin;
+ plugin = id;
+ id = null;
+ }
+
+ // Make sure the callback is a callback.
+ callback = (typeof callback === 'function') ? callback : null;
+
+ // Get the plugins.
+ var plugins = minplayer.plugins;
+
+ // 0x000
+ if (!id && !plugin && !callback) {
+ return plugins;
+ }
+ // 0x100
+ else if (id && !plugin && !callback) {
+ return plugins[id];
+ }
+ // 0x110
+ else if (id && plugin && !callback) {
+ return plugins[id][plugin];
+ }
+ // 0x111
+ else if (id && plugin && callback) {
+ minplayer.bind.call(this, 'ready', id, plugin, callback);
+ }
+ // 0x011
+ else if (!id && plugin && callback) {
+ for (var id in plugins) {
+ minplayer.bind.call(this, 'ready', id, plugin, callback);
+ }
+ }
+ // 0x101
+ else if (id && !plugin && callback) {
+ for (var plugin in plugins[id]) {
+ minplayer.bind.call(this, 'ready', id, plugin, callback);
+ }
+ }
+ // 0x010
+ else if (!id && plugin && !callback) {
+ var plugin_types = {};
+ for (var id in plugins) {
+ if (plugins.hasOwnProperty(id) && plugins[id].hasOwnProperty(plugin)) {
+ plugin_types[id] = plugins[id][plugin];
+ }
+ }
+ return plugin_types;
+ }
+ // 0x001
+ else {
+ for (var id in plugins) {
+ for (var plugin in plugins[id]) {
+ minplayer.bind.call(this, 'ready', id, plugin, callback);
+ }
+ }
+ }
+};
+/** The minplayer namespace. */
+minplayer = minplayer || {};
+
+/**
+ * @constructor
+ * @extends minplayer.plugin
+ * @class Base class used to provide the display and options for any component
+ * deriving from this class. Components who derive are expected to provide
+ * the elements that they define by implementing the getElements method.
+ *
+ * @param {string} name The name of this plugin.
+ * @param {object} context The jQuery context this component resides.
+ * @param {object} options The options for this component.
+ */
+minplayer.display = function(name, context, options) {
+
+ // See if we allow resize on this display.
+ this.allowResize = false;
+
+ if (context) {
+
+ // Set the display.
+ this.display = this.getDisplay(context, options);
+ }
+
+ // Derive from plugin
+ minplayer.plugin.call(this, name, context, options);
+};
+
+/** Derive from minplayer.plugin. */
+minplayer.display.prototype = new minplayer.plugin();
+
+/** Reset the constructor. */
+minplayer.display.prototype.constructor = minplayer.display;
+
+/**
+ * Returns the display for this component.
+ *
+ * @param {object} context The original context.
+ * @param {object} options The options for this component.
+ * @return {object} The jQuery context for this display.
+ */
+minplayer.display.prototype.getDisplay = function(context, options) {
+ return jQuery(context);
+};
+
+/**
+ * @see minplayer.plugin.construct
+ */
+minplayer.display.prototype.construct = function() {
+
+ // Call the plugin constructor.
+ minplayer.plugin.prototype.construct.call(this);
+
+ // Extend all display elements.
+ this.options.elements = this.options.elements || {};
+ jQuery.extend(this.options.elements, this.getElements());
+ this.elements = this.options.elements;
+
+ // Only do this if they allow resize for this display.
+ if (this.allowResize) {
+
+ // Set the resize timeout and this pointer.
+ var resizeTimeout = 0;
+ var _this = this;
+
+ // Add a handler to trigger a resize event.
+ jQuery(window).resize(function() {
+ clearTimeout(resizeTimeout);
+ resizeTimeout = setTimeout(function() {
+ _this.onResize();
+ }, 200);
+ });
+ }
+};
+
+/**
+ * Called when the window resizes.
+ */
+minplayer.display.prototype.onResize = function() {
+};
+
+/**
+ * Returns a scaled rectangle provided a ratio and the container rect.
+ *
+ * @param {number} ratio The width/height ratio of what is being scaled.
+ * @param {object} rect The bounding rectangle for scaling.
+ * @return {object} The Rectangle object of the scaled rectangle.
+ */
+minplayer.display.prototype.getScaledRect = function(ratio, rect) {
+ var scaledRect = {};
+ scaledRect.x = rect.x ? rect.x : 0;
+ scaledRect.y = rect.y ? rect.y : 0;
+ scaledRect.width = rect.width ? rect.width : 0;
+ scaledRect.height = rect.height ? rect.height : 0;
+ if (ratio) {
+ if ((rect.width / rect.height) > ratio) {
+ scaledRect.height = rect.height;
+ scaledRect.width = Math.floor(rect.height * ratio);
+ }
+ else {
+ scaledRect.height = Math.floor(rect.width / ratio);
+ scaledRect.width = rect.width;
+ }
+ scaledRect.x = Math.floor((rect.width - scaledRect.width) / 2);
+ scaledRect.y = Math.floor((rect.height - scaledRect.height) / 2);
+ }
+ return scaledRect;
+};
+
+/**
+ * Returns all the jQuery elements that this component uses.
+ *
+ * @return {object} An object which defines all the jQuery elements that
+ * this component uses.
+ */
+minplayer.display.prototype.getElements = function() {
+ return {};
+};
+
+/**
+ * Returns if this component is valid and exists within the DOM.
+ *
+ * @return {boolean} TRUE if the plugin display is valid.
+ */
+minplayer.display.prototype.isValid = function() {
+ return (this.display.length > 0);
+};
+// Add a way to instanciate using jQuery prototype.
+if (!jQuery.fn.minplayer) {
+
+ /**
+ * @constructor
+ *
+ * Define a jQuery minplayer prototype.
+ *
+ * @param {object} options The options for this jQuery prototype.
+ * @return {Array} jQuery object.
+ */
+ jQuery.fn.minplayer = function(options) {
+ return jQuery(this).each(function() {
+ options = options || {};
+ options.id = options.id || $(this).attr('id') || Math.random();
+ if (!minplayer.plugins[options.id]) {
+ var template = options.template || 'default';
+ if (minplayer[template]) {
+ new minplayer[template](jQuery(this), options);
+ }
+ else {
+ new minplayer(jQuery(this), options);
+ }
+ }
+ });
+ };
+}
+
+/**
+ * @constructor
+ * @extends minplayer.display
+ * @class The core media player class which governs the media player
+ * functionality.
+ *
+ * ' : '>';
+ this.options.elements.media.attr('src', '').empty().html(code);
+ }
+ }
+
+ // Always call the base first on load...
+ minplayer.players.base.prototype.load.call(this, file);
+};
+
+/**
+ * @see minplayer.players.base#play
+ */
+minplayer.players.html5.prototype.play = function() {
+ minplayer.players.base.prototype.play.call(this);
+ if (this.isReady()) {
+ this.player.play();
+ }
+};
+
+/**
+ * @see minplayer.players.base#pause
+ */
+minplayer.players.html5.prototype.pause = function() {
+ minplayer.players.base.prototype.pause.call(this);
+ if (this.isReady()) {
+ this.player.pause();
+ }
+};
+
+/**
+ * @see minplayer.players.base#stop
+ */
+minplayer.players.html5.prototype.stop = function() {
+ minplayer.players.base.prototype.stop.call(this);
+ if (this.isReady()) {
+ this.player.pause();
+ this.player.src = '';
+ }
+};
+
+/**
+ * @see minplayer.players.base#seek
+ */
+minplayer.players.html5.prototype.seek = function(pos) {
+ minplayer.players.base.prototype.seek.call(this, pos);
+ if (this.isReady()) {
+ this.player.currentTime = pos;
+ }
+};
+
+/**
+ * @see minplayer.players.base#setVolume
+ */
+minplayer.players.html5.prototype.setVolume = function(vol) {
+ minplayer.players.base.prototype.setVolume.call(this, vol);
+ if (this.isReady()) {
+ this.player.volume = vol;
+ }
+};
+
+/**
+ * @see minplayer.players.base#getVolume
+ */
+minplayer.players.html5.prototype.getVolume = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.volume);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getDuration
+ */
+minplayer.players.html5.prototype.getDuration = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.duration);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getCurrentTime
+ */
+minplayer.players.html5.prototype.getCurrentTime = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.currentTime);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesLoaded
+ */
+minplayer.players.html5.prototype.getBytesLoaded = function(callback) {
+ if (this.isReady()) {
+ var loaded = 0;
+
+ // Check several different possibilities.
+ if (this.bytesLoaded.value) {
+ loaded = this.bytesLoaded.value;
+ }
+ else if (this.player.buffered &&
+ this.player.buffered.length > 0 &&
+ this.player.buffered.end &&
+ this.player.duration) {
+ loaded = this.player.buffered.end(0);
+ }
+ else if (this.player.bytesTotal != undefined &&
+ this.player.bytesTotal > 0 &&
+ this.player.bufferedBytes != undefined) {
+ loaded = this.player.bufferedBytes;
+ }
+
+ // Return the loaded amount.
+ callback(loaded);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesTotal
+ */
+minplayer.players.html5.prototype.getBytesTotal = function(callback) {
+ if (this.isReady()) {
+
+ var total = 0;
+
+ // Check several different possibilities.
+ if (this.bytesTotal.value) {
+ total = this.bytesTotal.value;
+ }
+ else if (this.player.buffered &&
+ this.player.buffered.length > 0 &&
+ this.player.buffered.end &&
+ this.player.duration) {
+ total = this.player.duration;
+ }
+ else if (this.player.bytesTotal != undefined &&
+ this.player.bytesTotal > 0 &&
+ this.player.bufferedBytes != undefined) {
+ total = this.player.bytesTotal;
+ }
+
+ // Return the loaded amount.
+ callback(total);
+ }
+};
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** All the media player implementations */
+minplayer.players = minplayer.players || {};
+
+/**
+ * @constructor
+ * @extends minplayer.display
+ * @class The Flash media player class to control the flash fallback.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.players.flash = function(context, options) {
+
+ // Derive from players base.
+ minplayer.players.base.call(this, context, options);
+};
+
+/** Derive from minplayer.players.base. */
+minplayer.players.flash.prototype = new minplayer.players.base();
+
+/** Reset the constructor. */
+minplayer.players.flash.prototype.constructor = minplayer.players.flash;
+
+/**
+ * @see minplayer.players.base#getPriority
+ * @return {number} The priority of this media player.
+ */
+minplayer.players.flash.getPriority = function() {
+ return 0;
+};
+
+/**
+ * @see minplayer.players.base#canPlay
+ * @return {boolean} If this player can play this media type.
+ */
+minplayer.players.flash.canPlay = function(file) {
+ return false;
+};
+
+/**
+ * API to return the Flash player code provided params.
+ *
+ * @param {object} params The params used to populate the Flash code.
+ * @return {object} A Flash DOM element.
+ */
+minplayer.players.flash.getFlash = function(params) {
+ // Get the protocol.
+ var protocol = window.location.protocol;
+ if (protocol.charAt(protocol.length - 1) == ':') {
+ protocol = protocol.substring(0, protocol.length - 1);
+ }
+
+ // Convert the flashvars object to a string...
+ var flashVars = jQuery.param(params.flashvars);
+
+ // Set the codebase.
+ var codebase = protocol + '://fpdownload.macromedia.com';
+ codebase += '/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
+
+ // Get the HTML flash object string.
+ var flash = ' ';
+ flash += ' ';
+ flash += ' ';
+ flash += ' ';
+ flash += ' ';
+ flash += ' ';
+ flash += ' ';
+ flash += ' ';
+ flash += ' ';
+ return flash;
+};
+
+/**
+ * @see minplayer.players.base#playerFound
+ * @return {boolean} TRUE - if the player is in the DOM, FALSE otherwise.
+ */
+minplayer.players.flash.prototype.playerFound = function() {
+ return (this.display.find('object[playerType="flash"]').length > 0);
+};
+
+/**
+ * @see minplayer.players.base#getPlayer
+ * @return {object} The media player object.
+ */
+minplayer.players.flash.prototype.getPlayer = function() {
+ // IE needs the object, everyone else just needs embed.
+ var object = jQuery.browser.msie ? 'object' : 'embed';
+ return jQuery(object, this.display).eq(0)[0];
+};
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** All the media player implementations */
+minplayer.players = minplayer.players || {};
+
+/**
+ * @constructor
+ * @extends minplayer.display
+ * @class The Flash media player class to control the flash fallback.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.players.minplayer = function(context, options) {
+
+ // Derive from players flash.
+ minplayer.players.flash.call(this, context, options);
+};
+
+/** Derive from minplayer.players.flash. */
+minplayer.players.minplayer.prototype = new minplayer.players.flash();
+
+/** Reset the constructor. */
+minplayer.players.minplayer.prototype.constructor = minplayer.players.minplayer;
+
+/**
+ * Called when the Flash player is ready.
+ *
+ * @param {string} id The media player ID.
+ */
+window.onFlashPlayerReady = function(id) {
+ var media = minplayer.get(id, 'media');
+ if (media) {
+ media.onReady();
+ }
+};
+
+/**
+ * Called when the Flash player updates.
+ *
+ * @param {string} id The media player ID.
+ * @param {string} eventType The event type that was triggered.
+ */
+window.onFlashPlayerUpdate = function(id, eventType) {
+ var media = minplayer.get(id, 'media');
+ if (media) {
+ media.onMediaUpdate(eventType);
+ }
+};
+
+/**
+ * Used to debug from the Flash player to the browser console.
+ *
+ * @param {string} debug The debug string.
+ */
+window.onFlashPlayerDebug = function(debug) {
+ minplayer.console.log(debug);
+};
+
+/**
+ * @see minplayer.players.base#getPriority
+ * @return {number} The priority of this media player.
+ */
+minplayer.players.minplayer.getPriority = function() {
+ return 1;
+};
+
+/**
+ * @see minplayer.players.base#canPlay
+ * @return {boolean} If this player can play this media type.
+ */
+minplayer.players.minplayer.canPlay = function(file) {
+ switch (file.mimetype) {
+ case 'video/mp4':
+ case 'video/x-webm':
+ case 'video/webm':
+ case 'application/octet-stream':
+ case 'video/quicktime':
+ case 'video/3gpp2':
+ case 'video/3gpp':
+ case 'application/x-shockwave-flash':
+ case 'audio/mpeg':
+ case 'audio/mp4':
+ case 'audio/aac':
+ case 'audio/vnd.wave':
+ case 'audio/x-ms-wma':
+ return true;
+
+ default:
+ return false;
+ }
+};
+
+/**
+ * @see minplayer.players.base#create
+ * @return {object} The media player entity.
+ */
+minplayer.players.minplayer.prototype.create = function() {
+ minplayer.players.flash.prototype.create.call(this);
+
+ // The flash variables for this flash player.
+ var flashVars = {
+ 'id': this.options.id,
+ 'debug': this.options.debug,
+ 'config': 'nocontrols',
+ 'file': this.mediaFile.path,
+ 'autostart': this.options.autoplay
+ };
+
+ // Return a flash media player object.
+ return minplayer.players.flash.getFlash({
+ swf: this.options.swfplayer,
+ id: this.options.id + '_player',
+ width: this.options.width,
+ height: '100%',
+ flashvars: flashVars,
+ wmode: this.options.wmode
+ });
+};
+
+/**
+ * Called when the Flash player has an update.
+ *
+ * @param {string} eventType The event that was triggered in the player.
+ */
+minplayer.players.minplayer.prototype.onMediaUpdate = function(eventType) {
+ switch (eventType) {
+ case 'mediaMeta':
+ this.onLoaded();
+ break;
+ case 'mediaPlaying':
+ this.onPlaying();
+ break;
+ case 'mediaPaused':
+ this.onPaused();
+ break;
+ case 'mediaComplete':
+ this.onComplete();
+ break;
+ }
+};
+
+/**
+ * @see minplayer.players.base#load
+ */
+minplayer.players.minplayer.prototype.load = function(file) {
+ minplayer.players.flash.prototype.load.call(this, file);
+ if (file && this.isReady()) {
+ this.player.loadMedia(file.path, file.stream);
+ }
+};
+
+/**
+ * @see minplayer.players.base#play
+ */
+minplayer.players.minplayer.prototype.play = function() {
+ minplayer.players.flash.prototype.play.call(this);
+ if (this.isReady()) {
+ this.player.playMedia();
+ }
+};
+
+/**
+ * @see minplayer.players.base#pause
+ */
+minplayer.players.minplayer.prototype.pause = function() {
+ minplayer.players.flash.prototype.pause.call(this);
+ if (this.isReady()) {
+ this.player.pauseMedia();
+ }
+};
+
+/**
+ * @see minplayer.players.base#stop
+ */
+minplayer.players.minplayer.prototype.stop = function() {
+ minplayer.players.flash.prototype.stop.call(this);
+ if (this.isReady()) {
+ this.player.stopMedia();
+ }
+};
+
+/**
+ * @see minplayer.players.base#seek
+ */
+minplayer.players.minplayer.prototype.seek = function(pos) {
+ minplayer.players.flash.prototype.seek.call(this, pos);
+ if (this.isReady()) {
+ this.player.seekMedia(pos);
+ }
+};
+
+/**
+ * @see minplayer.players.base#setVolume
+ */
+minplayer.players.minplayer.prototype.setVolume = function(vol) {
+ minplayer.players.flash.prototype.setVolume.call(this, vol);
+ if (this.isReady()) {
+ this.player.setVolume(vol);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getVolume
+ */
+minplayer.players.minplayer.prototype.getVolume = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getVolume());
+ }
+};
+
+/**
+ * @see minplayer.players.flash#getDuration
+ */
+minplayer.players.minplayer.prototype.getDuration = function(callback) {
+ if (this.isReady()) {
+
+ // Check to see if it is immediately available.
+ var duration = this.player.getDuration();
+ if (duration) {
+ callback(duration);
+ }
+ else {
+
+ // If not, then check every half second...
+ var _this = this;
+ setTimeout(function check() {
+ duration = _this.player.getDuration();
+ if (duration) {
+ callback(duration);
+ }
+ else {
+ setTimeout(check, 500);
+ }
+ }, 500);
+ }
+ }
+};
+
+/**
+ * @see minplayer.players.base#getCurrentTime
+ */
+minplayer.players.minplayer.prototype.getCurrentTime = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getCurrentTime());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesLoaded
+ */
+minplayer.players.minplayer.prototype.getBytesLoaded = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getMediaBytesLoaded());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesTotal.
+ */
+minplayer.players.minplayer.prototype.getBytesTotal = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getMediaBytesTotal());
+ }
+};
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** All the media player implementations */
+minplayer.players = minplayer.players || {};
+
+/**
+ * @constructor
+ * @extends minplayer.players.base
+ * @class The YouTube media player.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.players.youtube = function(context, options) {
+
+ /** The quality of the YouTube stream. */
+ this.quality = 'default';
+
+ // Derive from players base.
+ minplayer.players.base.call(this, context, options);
+};
+
+/** Derive from minplayer.players.base. */
+minplayer.players.youtube.prototype = new minplayer.players.base();
+
+/** Reset the constructor. */
+minplayer.players.youtube.prototype.constructor = minplayer.players.youtube;
+
+/**
+ * @see minplayer.players.base#getPriority
+ * @return {number} The priority of this media player.
+ */
+minplayer.players.youtube.getPriority = function() {
+ return 10;
+};
+
+/**
+ * @see minplayer.players.base#canPlay
+ * @return {boolean} If this player can play this media type.
+ */
+minplayer.players.youtube.canPlay = function(file) {
+
+ // Check for the mimetype for youtube.
+ if (file.mimetype === 'video/youtube') {
+ return true;
+ }
+
+ // If the path is a YouTube path, then return true.
+ return (file.path.search(/^http(s)?\:\/\/(www\.)?youtube\.com/i) === 0);
+};
+
+/**
+ * Return the ID for a provided media file.
+ *
+ * @param {object} file A {@link minplayer.file} object.
+ * @return {string} The ID for the provided media.
+ */
+minplayer.players.youtube.getMediaId = function(file) {
+ var regex = /^http[s]?\:\/\/(www\.)?youtube\.com\/watch\?v=([a-zA-Z0-9]+)/i;
+ if (file.path.search(regex) === 0) {
+ return file.path.replace(regex, '$2');
+ }
+ else {
+ return file.path;
+ }
+};
+
+/**
+ * Register this youtube player so that multiple players can be present
+ * on the same page without event collision.
+ */
+minplayer.players.youtube.prototype.register = function() {
+
+ /**
+ * Register the standard youtube api ready callback.
+ */
+ window.onYouTubePlayerAPIReady = function() {
+
+ // Iterate over each media player.
+ jQuery.each(minplayer.get(null, 'player'), function(id, player) {
+
+ // Make sure this is the youtube player.
+ if (player.currentPlayer == 'youtube') {
+
+ // Create a new youtube player object for this instance only.
+ var playerId = id + '-player';
+
+ // Set this players media.
+ player.media.player = new YT.Player(playerId, {
+ events: {
+ 'onReady': function(event) {
+ player.media.onReady(event);
+ },
+ 'onStateChange': function(event) {
+ player.media.onPlayerStateChange(event);
+ },
+ 'onPlaybackQualityChange': function(newQuality) {
+ player.media.onQualityChange(newQuality);
+ },
+ 'onError': function(errorCode) {
+ player.media.onError(errorCode);
+ }
+ }
+ });
+ }
+ });
+ }
+};
+
+/**
+ * Translates the player state for the YouTube API player.
+ *
+ * @param {number} playerState The YouTube player state.
+ */
+minplayer.players.youtube.prototype.setPlayerState = function(playerState) {
+ switch (playerState) {
+ case YT.PlayerState.CUED:
+ break;
+ case YT.PlayerState.BUFFERING:
+ this.onWaiting();
+ break;
+ case YT.PlayerState.PAUSED:
+ this.onPaused();
+ break;
+ case YT.PlayerState.PLAYING:
+ this.onPlaying();
+ break;
+ case YT.PlayerState.ENDED:
+ this.onComplete();
+ break;
+ default:
+ break;
+ }
+};
+
+/**
+ * Called when an error occurs.
+ *
+ * @param {string} event The onReady event that was triggered.
+ */
+minplayer.players.youtube.prototype.onReady = function(event) {
+ minplayer.players.base.prototype.onReady.call(this);
+ this.onLoaded();
+};
+
+/**
+ * Checks to see if this player can be found.
+ * @return {bool} TRUE - Player is found, FALSE - otherwise.
+ */
+minplayer.players.youtube.prototype.playerFound = function() {
+ var iframe = this.display.find('iframe#' + this.options.id + '-player');
+ return (iframe.length > 0);
+};
+
+/**
+ * Called when the player state changes.
+ *
+ * @param {object} event A JavaScript Event.
+ */
+minplayer.players.youtube.prototype.onPlayerStateChange = function(event) {
+ this.setPlayerState(event.data);
+};
+
+/**
+ * Called when the player quality changes.
+ *
+ * @param {string} newQuality The new quality for the change.
+ */
+minplayer.players.youtube.prototype.onQualityChange = function(newQuality) {
+ this.quality = newQuality;
+};
+
+/**
+ * Determines if the player should show the playloader.
+ *
+ * @return {bool} If this player implements its own playLoader.
+ */
+minplayer.players.youtube.prototype.hasPlayLoader = function() {
+ return true;
+};
+
+/**
+ * @see minplayer.players.base#create
+ * @return {object} The media player entity.
+ */
+minplayer.players.youtube.prototype.create = function() {
+ minplayer.players.base.prototype.create.call(this);
+
+ // Insert the YouTube iframe API player.
+ var tag = document.createElement('script');
+ tag.src = 'http://www.youtube.com/player_api?enablejsapi=1';
+ var firstScriptTag = document.getElementsByTagName('script')[0];
+ firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
+
+ // Now register this player.
+ this.register();
+
+ // Create the iframe for this player.
+ var iframe = document.createElement('iframe');
+ iframe.setAttribute('id', this.options.id + '-player');
+ iframe.setAttribute('type', 'text/html');
+ iframe.setAttribute('width', '100%');
+ iframe.setAttribute('height', '100%');
+ iframe.setAttribute('frameborder', '0');
+
+ // Get the source.
+ var src = 'http://www.youtube.com/embed/';
+ src += this.mediaFile.id + '?';
+
+ // Determine the origin of this script.
+ var origin = location.protocol;
+ origin += '//' + location.hostname;
+ origin += (location.port && ':' + location.port);
+
+ // Add the parameters to the src.
+ src += jQuery.param({
+ 'wmode': 'opaque',
+ 'controls': 0,
+ 'enablejsapi': 1,
+ 'origin': origin,
+ 'autoplay': this.options.autoplay,
+ 'loop': this.options.loop
+ });
+
+ // Set the source of the iframe.
+ iframe.setAttribute('src', src);
+
+ // Return the player.
+ return iframe;
+};
+
+/**
+ * @see minplayer.players.base#load
+ */
+minplayer.players.youtube.prototype.load = function(file) {
+ minplayer.players.base.prototype.load.call(this, file);
+ if (file && this.isReady()) {
+ this.player.loadVideoById(file.id, 0, this.quality);
+ }
+};
+
+/**
+ * @see minplayer.players.base#play
+ */
+minplayer.players.youtube.prototype.play = function() {
+ minplayer.players.base.prototype.play.call(this);
+ if (this.isReady()) {
+ this.player.playVideo();
+ }
+};
+
+/**
+ * @see minplayer.players.base#pause
+ */
+minplayer.players.youtube.prototype.pause = function() {
+ minplayer.players.base.prototype.pause.call(this);
+ if (this.isReady()) {
+ this.player.pauseVideo();
+ }
+};
+
+/**
+ * @see minplayer.players.base#stop
+ */
+minplayer.players.youtube.prototype.stop = function() {
+ minplayer.players.base.prototype.stop.call(this);
+ if (this.isReady()) {
+ this.player.stopVideo();
+ }
+};
+
+/**
+ * @see minplayer.players.base#seek
+ */
+minplayer.players.youtube.prototype.seek = function(pos) {
+ minplayer.players.base.prototype.seek.call(this, pos);
+ if (this.isReady()) {
+ this.player.seekTo(pos, true);
+ }
+};
+
+/**
+ * @see minplayer.players.base#setVolume
+ */
+minplayer.players.youtube.prototype.setVolume = function(vol) {
+ minplayer.players.base.prototype.setVolume.call(this, vol);
+ if (this.isReady()) {
+ this.player.setVolume(vol * 100);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getVolume
+ */
+minplayer.players.youtube.prototype.getVolume = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getVolume());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getDuration.
+ */
+minplayer.players.youtube.prototype.getDuration = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getDuration());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getCurrentTime
+ */
+minplayer.players.youtube.prototype.getCurrentTime = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getCurrentTime());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesStart.
+ */
+minplayer.players.youtube.prototype.getBytesStart = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getVideoStartBytes());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesLoaded.
+ */
+minplayer.players.youtube.prototype.getBytesLoaded = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getVideoBytesLoaded());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesTotal.
+ */
+minplayer.players.youtube.prototype.getBytesTotal = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getVideoBytesTotal());
+ }
+};
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** All the media player implementations */
+minplayer.players = minplayer.players || {};
+
+/**
+ * @constructor
+ * @extends minplayer.players.base
+ * @class The vimeo media player.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.players.vimeo = function(context, options) {
+
+ // Derive from players base.
+ minplayer.players.base.call(this, context, options);
+};
+
+/** Derive from minplayer.players.base. */
+minplayer.players.vimeo.prototype = new minplayer.players.base();
+
+/** Reset the constructor. */
+minplayer.players.vimeo.prototype.constructor = minplayer.players.vimeo;
+
+/**
+ * @see minplayer.players.base#getPriority
+ * @return {number} The priority of this media player.
+ */
+minplayer.players.vimeo.getPriority = function() {
+ return 10;
+};
+
+/**
+ * @see minplayer.players.base#canPlay
+ * @return {boolean} If this player can play this media type.
+ */
+minplayer.players.vimeo.canPlay = function(file) {
+
+ // Check for the mimetype for vimeo.
+ if (file.mimetype === 'video/vimeo') {
+ return true;
+ }
+
+ // If the path is a vimeo path, then return true.
+ return (file.path.search(/^http(s)?\:\/\/(www\.)?vimeo\.com/i) === 0);
+};
+
+/**
+ * Return the ID for a provided media file.
+ *
+ * @param {object} file A {@link minplayer.file} object.
+ * @return {string} The ID for the provided media.
+ */
+minplayer.players.vimeo.getMediaId = function(file) {
+ var regex = /^http[s]?\:\/\/(www\.)?vimeo\.com\/(\?v\=)?([0-9]+)/i;
+ if (file.path.search(regex) === 0) {
+ return file.path.replace(regex, '$3');
+ }
+ else {
+ return file.path;
+ }
+};
+
+/**
+ * @see minplayer.players.base#reset
+ */
+minplayer.players.vimeo.prototype.reset = function() {
+
+ // Reset the flash variables..
+ minplayer.players.base.prototype.reset.call(this);
+};
+
+/**
+ * @see minplayer.players.base#create
+ * @return {object} The media player entity.
+ */
+minplayer.players.vimeo.prototype.create = function() {
+ minplayer.players.base.prototype.create.call(this);
+
+ // Insert the Vimeo Froogaloop player.
+ var tag = document.createElement('script');
+ tag.src = 'http://a.vimeocdn.com/js/froogaloop2.min.js';
+ var firstScriptTag = document.getElementsByTagName('script')[0];
+ firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
+
+ // Create the iframe for this player.
+ var iframe = document.createElement('iframe');
+ iframe.setAttribute('id', this.options.id + '-player');
+ iframe.setAttribute('type', 'text/html');
+ iframe.setAttribute('width', '100%');
+ iframe.setAttribute('height', '100%');
+ iframe.setAttribute('frameborder', '0');
+
+ // Get the source.
+ var src = 'http://player.vimeo.com/video/';
+ src += this.mediaFile.id + '?';
+
+ // Add the parameters to the src.
+ src += jQuery.param({
+ 'wmode': 'opaque',
+ 'api': 1,
+ 'player_id': this.options.id + '-player',
+ 'title': 0,
+ 'byline': 0,
+ 'portrait': 0,
+ 'autoplay': this.options.autoplay,
+ 'loop': this.options.loop
+ });
+
+ // Set the source of the iframe.
+ iframe.setAttribute('src', src);
+
+ // Now register this player when the froogaloop code is loaded.
+ var _this = this;
+ setTimeout(function check() {
+ if (window.Froogaloop) {
+ _this.player = window.Froogaloop(iframe);
+ _this.player.addEvent('ready', function() {
+ _this.onReady();
+ });
+ }
+ else {
+ setTimeout(check, 200);
+ }
+ }, 200);
+
+ // Trigger that the load has started.
+ this.trigger('loadstart');
+
+ // Return the player.
+ return iframe;
+};
+
+/**
+ * @see minplayer.players.base#onReady
+ */
+minplayer.players.vimeo.prototype.onReady = function(player_id) {
+ // Store the this pointer within this context.
+ var _this = this;
+
+ // Add the other listeners.
+ this.player.addEvent('loadProgress', function(progress) {
+
+ // Set the duration, bytesLoaded, and bytesTotal.
+ _this.duration.set(parseFloat(progress.duration));
+ _this.bytesLoaded.set(progress.bytesLoaded);
+ _this.bytesTotal.set(progress.bytesTotal);
+ });
+
+ this.player.addEvent('playProgress', function(progress) {
+
+ // Set the duration and current time.
+ _this.duration.set(parseFloat(progress.duration));
+ _this.currentTime.set(parseFloat(progress.seconds));
+ });
+
+ this.player.addEvent('play', function() {
+ _this.onPlaying();
+ });
+
+ this.player.addEvent('pause', function() {
+ _this.onPaused();
+ });
+
+ this.player.addEvent('finish', function() {
+ _this.onComplete();
+ });
+
+ minplayer.players.base.prototype.onReady.call(this);
+ this.onLoaded();
+};
+
+/**
+ * Checks to see if this player can be found.
+ * @return {bool} TRUE - Player is found, FALSE - otherwise.
+ */
+minplayer.players.vimeo.prototype.playerFound = function() {
+ var iframe = this.display.find('iframe#' + this.options.id + '-player');
+ return (iframe.length > 0);
+};
+
+/**
+ * @see minplayer.players.base#play
+ */
+minplayer.players.vimeo.prototype.play = function() {
+ minplayer.players.base.prototype.play.call(this);
+ if (this.isReady()) {
+ this.player.api('play');
+ }
+};
+
+/**
+ * @see minplayer.players.base#pause
+ */
+minplayer.players.vimeo.prototype.pause = function() {
+ minplayer.players.base.prototype.pause.call(this);
+ if (this.isReady()) {
+ this.player.api('pause');
+ }
+};
+
+/**
+ * @see minplayer.players.base#stop
+ */
+minplayer.players.vimeo.prototype.stop = function() {
+ minplayer.players.base.prototype.stop.call(this);
+ if (this.isReady()) {
+ this.player.api('unload');
+ }
+};
+
+/**
+ * @see minplayer.players.base#seek
+ */
+minplayer.players.vimeo.prototype.seek = function(pos) {
+ minplayer.players.base.prototype.seek.call(this, pos);
+ if (this.isReady()) {
+ this.player.api('seekTo', pos);
+ }
+};
+
+/**
+ * @see minplayer.players.base#setVolume
+ */
+minplayer.players.vimeo.prototype.setVolume = function(vol) {
+ minplayer.players.base.prototype.setVolume.call(this, vol);
+ if (this.isReady()) {
+ this.volume.set(vol);
+ this.player.api('setVolume', vol);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getVolume
+ */
+minplayer.players.vimeo.prototype.getVolume = function(callback) {
+ var _this = this;
+ this.player.api('getVolume', function(vol) {
+ callback(vol);
+ });
+};
+
+/**
+ * @see minplayer.players.base#getDuration.
+ */
+minplayer.players.vimeo.prototype.getDuration = function(callback) {
+ if (this.isReady()) {
+ if (this.duration.value) {
+ callback(this.duration.value);
+ }
+ else {
+ this.player.api('getDuration', function(duration) {
+ callback(duration);
+ });
+ }
+ }
+};
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** Define the controller object. */
+minplayer.controller = minplayer.controller || {};
+
+/**
+ * @constructor
+ * @extends minplayer.display
+ * @class This is the base minplayer controller. Other controllers can derive
+ * from the base and either build on top of it or simply define the elements
+ * that this base controller uses.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.controller.base = function(context, options) {
+
+ // Derive from display
+ minplayer.display.call(this, 'controller', context, options);
+};
+
+// Define the prototype for all controllers.
+var controllersBase = minplayer.controller.base;
+
+/** Derive from minplayer.display. */
+minplayer.controller.base.prototype = new minplayer.display();
+
+/** Reset the constructor. */
+minplayer.controller.base.prototype.constructor = minplayer.controller.base;
+
+/**
+ * A static function that will format a time value into a string time format.
+ *
+ * @param {integer} time An integer value of time.
+ * @return {string} A string representation of the time.
+ */
+minplayer.formatTime = function(time) {
+ time = time || 0;
+ var seconds = 0, minutes = 0, hour = 0, timeString = '';
+
+ hour = Math.floor(time / 3600);
+ time -= (hour * 3600);
+ minutes = Math.floor(time / 60);
+ time -= (minutes * 60);
+ seconds = Math.floor(time % 60);
+
+ if (hour) {
+ timeString += String(hour);
+ timeString += ':';
+ }
+
+ timeString += (minutes >= 10) ? String(minutes) : ('0' + String(minutes));
+ timeString += ':';
+ timeString += (seconds >= 10) ? String(seconds) : ('0' + String(seconds));
+ return {time: timeString, units: ''};
+};
+
+/**
+ * @see minplayer.display#getElements
+ * @return {object} The elements defined by this display.
+ */
+minplayer.controller.base.prototype.getElements = function() {
+ var elements = minplayer.display.prototype.getElements.call(this);
+ return jQuery.extend(elements, {
+ play: null,
+ pause: null,
+ fullscreen: null,
+ seek: null,
+ progress: null,
+ volume: null,
+ timer: null
+ });
+};
+
+/**
+ * @see minplayer.plugin#construct
+ */
+minplayer.controller.base.prototype.construct = function() {
+
+ // Call the minplayer plugin constructor.
+ minplayer.display.prototype.construct.call(this);
+
+ // If they have a fullscreen button.
+ if (this.elements.fullscreen) {
+
+ // Bind to the click event.
+ this.elements.fullscreen.bind('click', {obj: this}, function(event) {
+ var isFull = event.data.obj.elements.player.hasClass('fullscreen');
+ if (isFull) {
+ event.data.obj.elements.player.removeClass('fullscreen');
+ }
+ else {
+ event.data.obj.elements.player.addClass('fullscreen');
+ }
+ event.data.obj.trigger('fullscreen', !isFull);
+ }).css({'pointer' : 'hand'});
+ }
+
+ // Keep track of if we are dragging...
+ this.dragging = false;
+
+ // If they have a seek bar.
+ if (this.elements.seek) {
+
+ // Create the seek bar slider control.
+ this.seekBar = this.elements.seek.slider({
+ range: 'min'
+ });
+ }
+
+ // If they have a volume bar.
+ if (this.elements.volume) {
+
+ // Create the volume bar slider control.
+ this.volumeBar = this.elements.volume.slider({
+ range: 'min',
+ orientation: 'vertical'
+ });
+ }
+
+ // Get the media plugin.
+ this.get('media', function(media) {
+
+ var _this = this;
+
+ // If they have a pause button
+ if (this.elements.pause) {
+
+ // Bind to the click on this button.
+ this.elements.pause.unbind().bind('click', {obj: this}, function(event) {
+ event.preventDefault();
+ event.data.obj.playPause(false, media);
+ });
+
+ // Bind to the pause event of the media.
+ media.bind('pause', {obj: this}, function(event) {
+ event.data.obj.setPlayPause(true);
+ });
+ }
+
+ // If they have a play button
+ if (this.elements.play) {
+
+ // Bind to the click on this button.
+ this.elements.play.unbind().bind('click', {obj: this}, function(event) {
+ event.preventDefault();
+ event.data.obj.playPause(true, media);
+ });
+
+ // Bind to the play event of the media.
+ media.bind('playing', {obj: this}, function(event) {
+ event.data.obj.setPlayPause(false);
+ });
+ }
+
+ // If they have a duration, then trigger on duration change.
+ if (this.elements.duration) {
+
+ // Bind to the duration change event.
+ media.bind('durationchange', {obj: this}, function(event, data) {
+ event.data.obj.setTimeString('duration', data.duration);
+ });
+
+ // Set the timestring to the duration.
+ media.getDuration(function(duration) {
+ _this.setTimeString('duration', duration);
+ });
+ }
+
+ // If they have a progress element.
+ if (this.elements.progress) {
+
+ // Bind to the progress event.
+ media.bind('progress', {obj: this}, function(event, data) {
+ var percent = data.total ? (data.loaded / data.total) * 100 : 0;
+ event.data.obj.elements.progress.width(percent + '%');
+ });
+ }
+
+ // If they have a seek bar or timer, bind to the timeupdate.
+ if (this.seekBar || this.elements.timer) {
+
+ // Bind to the time update event.
+ media.bind('timeupdate', {obj: this}, function(event, data) {
+ if (!event.data.obj.dragging) {
+ var value = 0;
+ if (data.duration) {
+ value = (data.currentTime / data.duration) * 100;
+ }
+
+ // Update the seek bar if it exists.
+ if (event.data.obj.seekBar) {
+ event.data.obj.seekBar.slider('option', 'value', value);
+ }
+
+ event.data.obj.setTimeString('timer', data.currentTime);
+ }
+ });
+ }
+
+ // If they have a seekBar element.
+ if (this.seekBar) {
+
+ // Register the events for the control bar to control the media.
+ this.seekBar.slider({
+ start: function(event, ui) {
+ _this.dragging = true;
+ },
+ stop: function(event, ui) {
+ _this.dragging = false;
+ media.getDuration(function(duration) {
+ media.seek((ui.value / 100) * duration);
+ });
+ },
+ slide: function(event, ui) {
+ media.getDuration(function(duration) {
+ var time = (ui.value / 100) * duration;
+ if (!_this.dragging) {
+ media.seek(time);
+ }
+ _this.setTimeString('timer', time);
+ });
+ }
+ });
+ }
+
+ // Setup the volume bar.
+ if (this.volumeBar) {
+
+ // Create the slider.
+ this.volumeBar.slider({
+ slide: function(event, ui) {
+ media.setVolume(ui.value / 100);
+ }
+ });
+
+ media.bind('volumeupdate', {obj: this}, function(event, vol) {
+ event.data.obj.volumeBar.slider('option', 'value', (vol * 100));
+ });
+
+ // Set the volume to match that of the player.
+ media.getVolume(function(vol) {
+ _this.volumeBar.slider('option', 'value', (vol * 100));
+ });
+ }
+ });
+
+ // We are now ready.
+ this.ready();
+};
+
+/**
+ * Sets the play and pause state of the control bar.
+ *
+ * @param {boolean} state TRUE - Show Play, FALSE - Show Pause.
+ */
+minplayer.controller.base.prototype.setPlayPause = function(state) {
+ var css = '';
+ if (this.elements.play) {
+ css = state ? 'inherit' : 'none';
+ this.elements.play.css('display', css);
+ }
+ if (this.elements.pause) {
+ css = state ? 'none' : 'inherit';
+ this.elements.pause.css('display', css);
+ }
+};
+
+/**
+ * Plays or pauses the media.
+ *
+ * @param {bool} state true => play, false => pause.
+ * @param {object} media The media player object.
+ */
+minplayer.controller.base.prototype.playPause = function(state, media) {
+ var type = state ? 'play' : 'pause';
+ this.display.trigger(type);
+ this.setPlayPause(!state);
+ if (media) {
+ media[type]();
+ }
+};
+
+/**
+ * Sets the time string on the control bar.
+ *
+ * @param {string} element The name of the element to set.
+ * @param {number} time The total time amount to set.
+ */
+minplayer.controller.base.prototype.setTimeString = function(element, time) {
+ if (this.elements[element]) {
+ this.elements[element].text(minplayer.formatTime(time).time);
+ }
+};
diff --git a/core/modules/file/player/doc/files.html b/core/modules/file/player/doc/files.html
new file mode 100644
index 0000000..7e60ef9
--- /dev/null
+++ b/core/modules/file/player/doc/files.html
@@ -0,0 +1,428 @@
+
+
+
+
+
+ JsDoc Reference - File Index
+
+
+
+
+
+
+
+
+
+
+
+
File Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
\ No newline at end of file
diff --git a/core/modules/file/player/doc/index.html b/core/modules/file/player/doc/index.html
new file mode 100644
index 0000000..23967c1
--- /dev/null
+++ b/core/modules/file/player/doc/index.html
@@ -0,0 +1,347 @@
+
+
+
+
+
+ JsDoc Reference - Index
+
+
+
+
+
+
+
+
+
+
+
+
Class Index
+
+
+
+
+
+
+
+
+
+
+ This class keeps track of asynchronous get requests for certain
+variables within the player.
+
+
+
+
+
+ This class is used to define the types of media that can be played
+within the browser.
+
+
+
+
+
+ This is the base minplayer controller.
+
+
+
+
+
+ Base class used to provide the display and options for any component
+deriving from this class.
+
+
+
+
+
+ A wrapper class used to provide all the data necessary to control an
+individual file within this media player.
+
+
+
+
+
+ This is a class used to keep track of flag states
+which is used to control the busy cursor, big play button, among other
+items in which multiple components can have an interest in hiding or
+showing a single element on the screen.
+
+
+
+
+
+ A class to easily handle images.
+
+
+
+
+
+ The base media player class where all media players derive from.
+
+
+
+
+
+ The Flash media player class to control the flash fallback.
+
+
+
+
+
+ The HTML5 media player implementation.
+
+
+
+
+
+ The Flash media player class to control the flash fallback.
+
+
+
+
+
+ The vimeo media player.
+
+
+
+
+
+ The YouTube media player.
+
+
+
+
+
+ The play loader base class, which is used to control the busy
+cursor, big play button, and the opaque background which shows when the
+player is paused.
+
+
+
+
+
+ The base class for all plugins.
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/_global_.html b/core/modules/file/player/doc/symbols/_global_.html
new file mode 100644
index 0000000..2e682f3
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/_global_.html
@@ -0,0 +1,416 @@
+
+
+
+
+
+
+ JsDoc Reference - _global_
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Built-In Namespace _global_
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ The minplayer namespace.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ minplayer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+ checkPlayType (elem, playType)
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ elem
+
+
+
+
+
+ playType
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/jQuery.fn.minplayer.html b/core/modules/file/player/doc/symbols/jQuery.fn.minplayer.html
new file mode 100644
index 0000000..84429ec
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/jQuery.fn.minplayer.html
@@ -0,0 +1,349 @@
+
+
+
+
+
+
+ JsDoc Reference - jQuery.fn.minplayer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class jQuery.fn.minplayer
+
+
+
+
+
+
+
+
+
+
+ Defined in: minplayer.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ jQuery.fn.minplayer (options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} options
+
+
+ The options for this jQuery prototype.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {Array} jQuery object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.async.html b/core/modules/file/player/doc/symbols/minplayer.async.html
new file mode 100644
index 0000000..721b2d7
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.async.html
@@ -0,0 +1,539 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.async
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.async
+
+
+
+
+
+
+
+ This class keeps track of asynchronous get requests for certain
+variables within the player.
+
+
+ Defined in: minplayer.async.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ The queue of callbacks to call when this value is determined.
+
+
+
+
+
+
+
+ The final value of this asynchronous variable.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+
+
+ get (callback, pollValue)
+
+ Retrieve the value of this variable.
+
+
+
+
+
+
+
+ Sets the value of an asynchronous value.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.async ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ queue
+
+
+
+ The queue of callbacks to call when this value is determined.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ value
+
+
+
+ The final value of this asynchronous variable.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+ get (callback, pollValue)
+
+
+
+ Retrieve the value of this variable.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {function} callback
+
+
+ The function to call when the value is determined.
+
+
+ {function} pollValue
+
+
+ The poll function to try and get the value every
+1 second if the value is not set.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ set (val)
+
+
+
+ Sets the value of an asynchronous value.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {void} val
+
+
+ The value to set.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.compatibility.html b/core/modules/file/player/doc/symbols/minplayer.compatibility.html
new file mode 100644
index 0000000..47620dd
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.compatibility.html
@@ -0,0 +1,576 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.compatibility
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.compatibility
+
+
+
+
+
+
+
+ This class is used to define the types of media that can be played
+within the browser.
+
+Usage:
+
+ var playTypes = new minplayer.compatibility();
+
+ if (playTypes.videoOGG) {
+ console.log("This browser can play OGG video");
+ }
+
+ if (playTypes.videoH264) {
+ console.log("This browser can play H264 video");
+ }
+
+ if (playTypes.videoWEBM) {
+ console.log("This browser can play WebM video");
+ }
+
+ if (playTypes.audioOGG) {
+ console.log("This browser can play OGG audio");
+ }
+
+ if (playTypes.audioMP3) {
+ console.log("This browser can play MP3 audio");
+ }
+
+ if (playTypes.audioMP4) {
+ console.log("This browser can play MP4 audio");
+ }
+
+
+
+
Defined in: minplayer.compatibility.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Can play audio MP3
+
+
+
+
+
+
+
+ Can play audio MP4
+
+
+
+
+
+
+
+ Can play audio OGG
+
+
+
+
+
+
+
+ Can play H264 video
+
+
+
+
+
+
+
+ Can play OGG video
+
+
+
+
+
+
+
+ Can play WEBM video
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.compatibility ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ audioMP3
+
+
+
+ Can play audio MP3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ audioMP4
+
+
+
+ Can play audio MP4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ audioOGG
+
+
+
+ Can play audio OGG
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ videoH264
+
+
+
+ Can play H264 video
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ videoOGG
+
+
+
+ Can play OGG video
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ videoWEBM
+
+
+
+ Can play WEBM video
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.controller.base.html b/core/modules/file/player/doc/symbols/minplayer.controller.base.html
new file mode 100644
index 0000000..b886c83
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.controller.base.html
@@ -0,0 +1,674 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.controller.base
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.controller.base
+
+
+
+
+
+ Extends
+ minplayer.display .
+
+
+ This is the base minplayer controller. Other controllers can derive
+from the base and either build on top of it or simply define the elements
+that this base controller uses.
+
+
+ Defined in: minplayer.controller.base.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+ Fields borrowed from class minplayer.plugin : lock , name , options , pluginReady , queue , triggered
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Plays or pauses the media.
+
+
+
+
+
+
+
+ Sets the play and pause state of the control bar.
+
+
+
+
+
+
+
+ Sets the time string on the control bar.
+
+
+
+
+
+
+
+
+
+ Methods borrowed from class minplayer.display : getDisplay , getScaledRect , isValid , onResize Methods borrowed from class minplayer.plugin : addPlugin , bind , checkQueue , destroy , get , loadPlugins , ready , trigger , unbind
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.controller.base (context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} context
+
+
+ The jQuery context.
+
+
+ {object} options
+
+
+ This components options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ constructor
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+ construct ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.plugin#construct
+
+
+
+
+
+
+
+
+
+ {object}
+ getElements ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The elements defined by this display.
+
+
+
+
+
+
+ See:
+
+ minplayer.display#getElements
+
+
+
+
+
+
+
+
+
+
+ playPause (state, media)
+
+
+
+ Plays or pauses the media.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {bool} state
+
+
+ true => play, false => pause.
+
+
+ {object} media
+
+
+ The media player object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setPlayPause (state)
+
+
+
+ Sets the play and pause state of the control bar.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {boolean} state
+
+
+ TRUE - Show Play, FALSE - Show Pause.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setTimeString (element, time)
+
+
+
+ Sets the time string on the control bar.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} element
+
+
+ The name of the element to set.
+
+
+ {number} time
+
+
+ The total time amount to set.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.controllers.base.html b/core/modules/file/player/doc/symbols/minplayer.controllers.base.html
new file mode 100644
index 0000000..71479db
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.controllers.base.html
@@ -0,0 +1,674 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.controllers.base
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.controllers.base
+
+
+
+
+
+ Extends
+ minplayer.display .
+
+
+ This is the base minplayer controller. Other controllers can derive
+from the base and either build on top of it or simply define the elements
+that this base controller uses.
+
+
+ Defined in: minplayer.controllers.base.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+ Fields borrowed from class minplayer.plugin : name , options , pluginReady , queue
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Plays or pauses the media.
+
+
+
+
+
+
+
+ Sets the play and pause state of the control bar.
+
+
+
+
+
+
+
+ Sets the time string on the control bar.
+
+
+
+
+
+
+
+
+
+ Methods borrowed from class minplayer.display : bind , getDisplay , getScaledRect , isValid , onResize , trigger Methods borrowed from class minplayer.plugin : addPlugin , checkQueue , destroy , get , loadPlugins , ready
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.controllers.base (context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} context
+
+
+ The jQuery context.
+
+
+ {object} options
+
+
+ This components options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ constructor
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+ construct ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.plugin#construct
+
+
+
+
+
+
+
+
+
+ {object}
+ getElements ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The elements defined by this display.
+
+
+
+
+
+
+ See:
+
+ minplayer.display#getElements
+
+
+
+
+
+
+
+
+
+
+ playPause (state, media)
+
+
+
+ Plays or pauses the media.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {bool} state
+
+
+ true => play, false => pause.
+
+
+ {object} media
+
+
+ The media player object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setPlayPause (state)
+
+
+
+ Sets the play and pause state of the control bar.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {boolean} state
+
+
+ TRUE - Show Play, FALSE - Show Pause.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setTimeString (element, time)
+
+
+
+ Sets the time string on the control bar.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} element
+
+
+ The name of the element to set.
+
+
+ {number} time
+
+
+ The total time amount to set.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Sun Feb 19 2012 00:13:02 GMT-0600 (CST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.display.html b/core/modules/file/player/doc/symbols/minplayer.display.html
new file mode 100644
index 0000000..3d70a66
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.display.html
@@ -0,0 +1,718 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.display
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.display
+
+
+
+
+
+ Extends
+ minplayer.plugin .
+
+
+ Base class used to provide the display and options for any component
+deriving from this class. Components who derive are expected to provide
+the elements that they define by implementing the getElements method.
+
+
+ Defined in: minplayer.display.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+ Fields borrowed from class minplayer.plugin : lock , name , options , pluginReady , queue , triggered
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns the display for this component.
+
+
+
+
+
+
+
+ Returns all the jQuery elements that this component uses.
+
+
+
+
+
+
+
+ Returns a scaled rectangle provided a ratio and the container rect.
+
+
+
+
+
+
+
+ Returns if this component is valid and exists within the DOM.
+
+
+
+
+
+
+
+ Called when the window resizes.
+
+
+
+
+
+
+
+
+
+ Methods borrowed from class minplayer.plugin : addPlugin , bind , checkQueue , destroy , get , loadPlugins , ready , trigger , unbind
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.display (name, context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} name
+
+
+ The name of this plugin.
+
+
+ {object} context
+
+
+ The jQuery context this component resides.
+
+
+ {object} options
+
+
+ The options for this component.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ constructor
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+ construct ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.plugin.construct
+
+
+
+
+
+
+
+
+
+ {object}
+ getDisplay (context, options)
+
+
+
+ Returns the display for this component.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} context
+
+
+ The original context.
+
+
+ {object} options
+
+
+ The options for this component.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The jQuery context for this display.
+
+
+
+
+
+
+
+
+
+
+
+ {object}
+ getElements ()
+
+
+
+ Returns all the jQuery elements that this component uses.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} An object which defines all the jQuery elements that
+this component uses.
+
+
+
+
+
+
+
+
+
+
+
+ {object}
+ getScaledRect (ratio, rect)
+
+
+
+ Returns a scaled rectangle provided a ratio and the container rect.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {number} ratio
+
+
+ The width/height ratio of what is being scaled.
+
+
+ {object} rect
+
+
+ The bounding rectangle for scaling.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The Rectangle object of the scaled rectangle.
+
+
+
+
+
+
+
+
+
+
+
+ {boolean}
+ isValid ()
+
+
+
+ Returns if this component is valid and exists within the DOM.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {boolean} TRUE if the plugin display is valid.
+
+
+
+
+
+
+
+
+
+
+
+
+ onResize ()
+
+
+
+ Called when the window resizes.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.file.html b/core/modules/file/player/doc/symbols/minplayer.file.html
new file mode 100644
index 0000000..af98fd3
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.file.html
@@ -0,0 +1,615 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.file
+
+
+
+
+
+
+
+ A wrapper class used to provide all the data necessary to control an
+individual file within this media player.
+
+
+ Defined in: minplayer.file.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+
+
+
+ Returns the best player for the job.
+
+
+
+
+
+
+
+ Returns the file extension of the file path.
+
+
+
+
+
+
+
+ Returns the ID for this media file.
+
+
+
+
+
+
+
+ Returns the proper mimetype based off of the extension.
+
+
+
+
+
+
+
+ The priority of this file is determined by the priority of the best
+player multiplied by the priority of the mimetype.
+
+
+
+
+
+
+
+ The type of media this is: video or audio.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.file (file)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} file
+
+
+ A media file object with minimal required information.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+ {string}
+ getBestPlayer ()
+
+
+
+ Returns the best player for the job.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {string} The best player to play the media file.
+
+
+
+
+
+
+
+
+
+
+
+ {string}
+ getFileExtension ()
+
+
+
+ Returns the file extension of the file path.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {string} The file extension.
+
+
+
+
+
+
+
+
+
+
+
+ {string}
+ getId ()
+
+
+
+ Returns the ID for this media file.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {string} The id for this media file which is provided by the player.
+
+
+
+
+
+
+
+
+
+
+
+ {string}
+ getMimeType ()
+
+
+
+ Returns the proper mimetype based off of the extension.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {string} The mimetype of the file based off of extension.
+
+
+
+
+
+
+
+
+
+
+
+ {integer}
+ getPriority ()
+
+
+
+ The priority of this file is determined by the priority of the best
+player multiplied by the priority of the mimetype.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {integer} The priority of the media file.
+
+
+
+
+
+
+
+
+
+
+
+ {string}
+ getType ()
+
+
+
+ The type of media this is: video or audio.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {string} "video" or "audio" based on what the type of media this
+is.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.flags.html b/core/modules/file/player/doc/symbols/minplayer.flags.html
new file mode 100644
index 0000000..665aea8
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.flags.html
@@ -0,0 +1,554 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.flags
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.flags
+
+
+
+
+
+
+
+ This is a class used to keep track of flag states
+which is used to control the busy cursor, big play button, among other
+items in which multiple components can have an interest in hiding or
+showing a single element on the screen.
+
+
+Usage:
+
+ // Declare a flags variable.
+ var flags = new minplayer.flags();
+
+ // Set the flag based on two components interested in the flag.
+ flags.setFlag("component1", true);
+ flags.setFlag("component2", true);
+
+ // Print out the value of the flags. ( Prints 3 )
+ console.log(flags.flags);
+
+ // Now unset a single components flag.
+ flags.setFlag("component1", false);
+
+ // Print out the value of the flags.
+ console.log(flags.flags);
+
+ // Unset the other components flag.
+ flags.setFlag("component2", false);
+
+ // Print out the value of the flags.
+ console.log(flags.flags);
+
+
+
+
+
Defined in: minplayer.flags.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ The flag.
+
+
+
+
+
+
+
+ Id map to reference id with the flag index.
+
+
+
+
+
+
+
+ The number of flags.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+
+
+
+ Sets a flag based on boolean logic operators.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.flags ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ flag
+
+
+
+ The flag.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ids
+
+
+
+ Id map to reference id with the flag index.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ numFlags
+
+
+
+ The number of flags.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+ setFlag (id, value)
+
+
+
+ Sets a flag based on boolean logic operators.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} id
+
+
+ The id of the controller interested in this flag.
+
+
+ {boolean} value
+
+
+ The value of this flag ( true or false ).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.image.html b/core/modules/file/player/doc/symbols/minplayer.image.html
new file mode 100644
index 0000000..ba78d1f
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.image.html
@@ -0,0 +1,681 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.image
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.image
+
+
+
+
+
+
+
+ A class to easily handle images.
+
+
+ Defined in: minplayer.image.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+ The loader for the image.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+
+
+
+ Clears an image.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loads an image.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Resize the image provided a width and height or nothing.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.image (context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} context
+
+
+ The jQuery context.
+
+
+ {object} options
+
+
+ This components options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ constructor
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ loader
+
+
+
+ The loader for the image.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+ clear (callback)
+
+
+
+ Clears an image.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {function} callback
+
+
+ Called when the image is done clearing.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ construct ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.plugin.construct
+
+
+
+
+
+
+
+
+
+
+ load (src)
+
+
+
+ Loads an image.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} src
+
+
+ The source of the image to load.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onResize ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.display#onResize
+
+
+
+
+
+
+
+
+
+
+ resize (width, height)
+
+
+
+ Resize the image provided a width and height or nothing.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {integer} width
+
+
+ (optional) The width of the container.
+
+
+ {integer} height
+
+
+ (optional) The height of the container.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.playLoader.base.html b/core/modules/file/player/doc/symbols/minplayer.playLoader.base.html
new file mode 100644
index 0000000..34f0033
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.playLoader.base.html
@@ -0,0 +1,574 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.playLoader.base
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.playLoader.base
+
+
+
+
+
+ Extends
+ minplayer.display .
+
+
+ The play loader base class, which is used to control the busy
+cursor, big play button, and the opaque background which shows when the
+player is paused.
+
+
+ Defined in: minplayer.playLoader.base.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+ The preview image.
+
+
+
+
+
+
+
+
+
+ Fields borrowed from class minplayer.plugin : lock , name , options , pluginReady , queue , triggered
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+
+
+
+ Hide or show certain elements based on the state of the busy and big play
+button.
+
+
+
+
+
+
+
+ The constructor.
+
+
+
+
+
+
+
+ Loads the preview image.
+
+
+
+
+
+
+
+
+
+ Methods borrowed from class minplayer.display : getDisplay , getElements , getScaledRect , isValid , onResize Methods borrowed from class minplayer.plugin : addPlugin , bind , checkQueue , destroy , get , loadPlugins , ready , trigger , unbind
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.playLoader.base (context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} context
+
+
+ The jQuery context.
+
+
+ {object} options
+
+
+ This components options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ constructor
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ preview
+
+
+
+ The preview image.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+ checkVisibility ()
+
+
+
+ Hide or show certain elements based on the state of the busy and big play
+button.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ construct ()
+
+
+
+ The constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ loadPreview ()
+
+
+
+ Loads the preview image.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.players.base.html b/core/modules/file/player/doc/symbols/minplayer.players.base.html
new file mode 100644
index 0000000..8fd8e3c
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.players.base.html
@@ -0,0 +1,1874 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.players.base
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.players.base
+
+
+
+
+
+ Extends
+ minplayer.display .
+
+
+ The base media player class where all media players derive from.
+
+
+ Defined in: minplayer.players.base.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+ The currently loaded media file.
+
+
+
+
+
+
+
+
+
+ Fields borrowed from class minplayer.plugin : lock , name , options , pluginReady , queue , triggered
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+ <static>
+
+ minplayer.players.base.
canPlay (file)
+
+ Determine if we can play the media file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates the media player and inserts it in the DOM.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Return the bytes of media loaded.
+
+
+
+
+
+
+
+ Return the start bytes for the loaded media.
+
+
+
+
+
+
+
+ Return the total amount of bytes.
+
+
+
+
+
+
+
+ Get the current time for the media being played.
+
+
+
+
+
+
+
+ Return the duration of the loaded media.
+
+
+
+
+ <static>
+
+
+ Returns the ID for the media being played.
+
+
+
+
+
+
+
+ Returns the media player object.
+
+
+
+
+ <static>
+
+
+ Get the priority of this media player.
+
+
+
+
+
+
+
+ Get the volume from the loaded media.
+
+
+
+
+
+
+
+ Determines if the player should show the playloader.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loads a new media player.
+
+
+
+
+
+
+
+ Should be called when the media is complete.
+
+
+
+
+
+
+
+ Called when an error occurs.
+
+
+
+
+
+
+
+ Should be called when the media is done loading.
+
+
+
+
+
+
+
+ Should be called when the media is paused.
+
+
+
+
+
+
+
+ Should be called when the media is playing.
+
+
+
+
+
+
+
+ Called when the player is ready to recieve events and commands.
+
+
+
+
+
+
+
+ Should be called when the player is waiting.
+
+
+
+
+
+
+
+ Pause the loaded media file.
+
+
+
+
+
+
+
+ Play the loaded media file.
+
+
+
+
+
+
+
+ Returns if the media player is already within the DOM.
+
+
+
+
+
+
+
+ Create a polling timer.
+
+
+
+
+
+
+
+ Resets all variables.
+
+
+
+
+
+
+
+ Seek the loaded media.
+
+
+
+
+
+
+
+ Seeks to relative position.
+
+
+
+
+
+
+
+ Set the volume of the loaded minplayer.
+
+
+
+
+
+
+
+ Set the volume of the loaded minplayer.
+
+
+
+
+
+
+
+ Stop the loaded media file.
+
+
+
+
+
+
+
+
+
+ Methods borrowed from class minplayer.display : getDisplay , getElements , getScaledRect , isValid , onResize Methods borrowed from class minplayer.plugin : addPlugin , bind , checkQueue , get , loadPlugins , ready , trigger , unbind
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.players.base (context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} context
+
+
+ The jQuery context.
+
+
+ {object} options
+
+
+ This components options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ constructor
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mediaFile
+
+
+
+ The currently loaded media file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
<static>
+
+ {boolean}
+ minplayer.players.base. canPlay (file)
+
+
+
+ Determine if we can play the media file.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} file
+
+
+ A minplayer.file object.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {boolean} If this player can play this media type.
+
+
+
+
+
+
+
+
+
+
+
+
+ construct ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.plugin.construct
+
+
+
+
+
+
+
+
+
+ {object}
+ create ()
+
+
+
+ Creates the media player and inserts it in the DOM.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The media player entity.
+
+
+
+
+
+
+
+
+
+
+
+
+ destroy ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.plugin.destroy.
+
+
+
+
+
+
+
+
+
+ {int}
+ getBytesLoaded (callback)
+
+
+
+ Return the bytes of media loaded.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {function} callback
+
+
+ Called when the bytes loaded is determined.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {int} The amount of bytes loaded.
+
+
+
+
+
+
+
+
+
+
+
+ {int}
+ getBytesStart (callback)
+
+
+
+ Return the start bytes for the loaded media.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {function} callback
+
+
+ Called when the start bytes is determined.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {int} The bytes that were started.
+
+
+
+
+
+
+
+
+
+
+
+ {int}
+ getBytesTotal (callback)
+
+
+
+ Return the total amount of bytes.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {function} callback
+
+
+ Called when the bytes total is determined.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {int} The total amount of bytes for this media.
+
+
+
+
+
+
+
+
+
+
+
+ {number}
+ getCurrentTime (callback)
+
+
+
+ Get the current time for the media being played.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {function} callback
+
+
+ Called when the time is determined.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {number} The volume of the media; 0 to 1.
+
+
+
+
+
+
+
+
+
+
+
+ {number}
+ getDuration (callback)
+
+
+
+ Return the duration of the loaded media.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {function} callback
+
+
+ Called when the duration is determined.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {number} The duration of the loaded media.
+
+
+
+
+
+
+
+
+
+
<static>
+
+ {string}
+ minplayer.players.base. getMediaId (file)
+
+
+
+ Returns the ID for the media being played.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} file
+
+
+ A minplayer.file object.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {string} The ID for the provided media.
+
+
+
+
+
+
+
+
+
+
+
+ {object}
+ getPlayer ()
+
+
+
+ Returns the media player object.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The media player object.
+
+
+
+
+
+
+
+
+
+
<static>
+
+ {number}
+ minplayer.players.base. getPriority ()
+
+
+
+ Get the priority of this media player.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {number} The priority of this media player.
+
+
+
+
+
+
+
+
+
+
+
+ {number}
+ getVolume (callback)
+
+
+
+ Get the volume from the loaded media.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {function} callback
+
+
+ Called when the volume is determined.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {number} The volume of the media; 0 to 1.
+
+
+
+
+
+
+
+
+
+
+
+ {bool}
+ hasPlayLoader ()
+
+
+
+ Determines if the player should show the playloader.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {bool} If this player implements its own playLoader.
+
+
+
+
+
+
+
+
+
+
+
+ {boolean}
+ isReady ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {boolean} Checks to see if the Flash is ready.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#isReady
+
+
+
+
+
+
+
+
+
+
+ load (file)
+
+
+
+ Loads a new media player.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} file
+
+
+ A minplayer.file object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onComplete ()
+
+
+
+ Should be called when the media is complete.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onError (errorCode)
+
+
+
+ Called when an error occurs.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} errorCode
+
+
+ The error that was triggered.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onLoaded ()
+
+
+
+ Should be called when the media is done loading.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onPaused ()
+
+
+
+ Should be called when the media is paused.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onPlaying ()
+
+
+
+ Should be called when the media is playing.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onReady ()
+
+
+
+ Called when the player is ready to recieve events and commands.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onWaiting ()
+
+
+
+ Should be called when the player is waiting.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pause ()
+
+
+
+ Pause the loaded media file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ play ()
+
+
+
+ Play the loaded media file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {boolean}
+ playerFound ()
+
+
+
+ Returns if the media player is already within the DOM.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {boolean} TRUE - if the player is in the DOM, FALSE otherwise.
+
+
+
+
+
+
+
+
+
+
+
+
+ poll (callback)
+
+
+
+ Create a polling timer.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {function} callback
+
+
+ The function to call when you poll.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ reset ()
+
+
+
+ Resets all variables.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ seek (pos)
+
+
+
+ Seek the loaded media.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {number} pos
+
+
+ The position to seek the minplayer. 0 to 1.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ seekRelative (pos)
+
+
+
+ Seeks to relative position.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {number} pos
+
+
+ Relative position. -1 to 1 (percent), > 1 (seconds).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setVolume (vol)
+
+
+
+ Set the volume of the loaded minplayer.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {number} vol
+
+
+ The volume to set the media. 0 to 1.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setVolumeRelative (vol)
+
+
+
+ Set the volume of the loaded minplayer.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {number} vol
+
+
+ -1 to 1 - The relative amount to increase or decrease.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ stop ()
+
+
+
+ Stop the loaded media file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.players.flash.html b/core/modules/file/player/doc/symbols/minplayer.players.flash.html
new file mode 100644
index 0000000..ea705cd
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.players.flash.html
@@ -0,0 +1,691 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.players.flash
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.players.flash
+
+
+
+
+
+ Extends
+ minplayer.display .
+
+
+ The Flash media player class to control the flash fallback.
+
+
+ Defined in: minplayer.players.flash.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+ Fields borrowed from class minplayer.plugin : lock , name , options , pluginReady , queue , triggered
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+ <static>
+
+ minplayer.players.flash.
canPlay (file)
+
+
+
+
+
+
+ <static>
+
+ minplayer.players.flash.
getFlash (params)
+
+ API to return the Flash player code provided params.
+
+
+
+
+
+
+
+
+
+
+
+
+ <static>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Methods borrowed from class minplayer.display : construct , getDisplay , getElements , getScaledRect , isValid , onResize Methods borrowed from class minplayer.plugin : addPlugin , bind , checkQueue , destroy , get , loadPlugins , ready , trigger , unbind
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.players.flash (context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} context
+
+
+ The jQuery context.
+
+
+ {object} options
+
+
+ This components options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ constructor
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
<static>
+
+ {boolean}
+ minplayer.players.flash. canPlay (file)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ file
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {boolean} If this player can play this media type.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#canPlay
+
+
+
+
+
+
+
+
<static>
+
+ {object}
+ minplayer.players.flash. getFlash (params)
+
+
+
+ API to return the Flash player code provided params.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} params
+
+
+ The params used to populate the Flash code.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} A Flash DOM element.
+
+
+
+
+
+
+
+
+
+
+
+ {object}
+ getPlayer ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The media player object.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getPlayer
+
+
+
+
+
+
+
+
<static>
+
+ {number}
+ minplayer.players.flash. getPriority ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {number} The priority of this media player.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getPriority
+
+
+
+
+
+
+
+
+
+ {boolean}
+ playerFound ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {boolean} TRUE - if the player is in the DOM, FALSE otherwise.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#playerFound
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.players.html5.html b/core/modules/file/player/doc/symbols/minplayer.players.html5.html
new file mode 100644
index 0000000..3893871
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.players.html5.html
@@ -0,0 +1,1267 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.players.html5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.players.html5
+
+
+
+
+
+ Extends
+ minplayer.display .
+
+
+ The HTML5 media player implementation.
+
+
+ Defined in: minplayer.players.html5.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+ Fields borrowed from class minplayer.plugin : lock , name , options , pluginReady , queue , triggered
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+ <static>
+
+ minplayer.players.html5.
canPlay (file)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <static>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Methods borrowed from class minplayer.display : getDisplay , getElements , getScaledRect , isValid , onResize Methods borrowed from class minplayer.plugin : addPlugin , bind , checkQueue , destroy , get , loadPlugins , ready , trigger , unbind
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.players.html5 (context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} context
+
+
+ The jQuery context.
+
+
+ {object} options
+
+
+ This components options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ constructor
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
<static>
+
+ {boolean}
+ minplayer.players.html5. canPlay (file)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ file
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {boolean} If this player can play this media type.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#canPlay
+
+
+
+
+
+
+
+
+
+
+ construct ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.plugin.construct
+
+
+
+
+
+
+
+
+
+ {object}
+ create ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The media player entity.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#create
+
+
+
+
+
+
+
+
+
+
+ getBytesLoaded (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getBytesLoaded
+
+
+
+
+
+
+
+
+
+
+ getBytesTotal (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getBytesTotal
+
+
+
+
+
+
+
+
+
+
+ getCurrentTime (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getCurrentTime
+
+
+
+
+
+
+
+
+
+
+ getDuration (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getDuration
+
+
+
+
+
+
+
+
+
+ {object}
+ getPlayer ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The media player object.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getPlayer
+
+
+
+
+
+
+
+
<static>
+
+ {number}
+ minplayer.players.html5. getPriority ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {number} The priority of this media player.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getPriority
+
+
+
+
+
+
+
+
+
+
+ getVolume (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getVolume
+
+
+
+
+
+
+
+
+
+
+ load (file)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ file
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#load
+
+
+
+
+
+
+
+
+
+
+ pause ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#pause
+
+
+
+
+
+
+
+
+
+
+ play ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#play
+
+
+
+
+
+
+
+
+
+ {boolean}
+ playerFound ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {boolean} TRUE - if the player is in the DOM, FALSE otherwise.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#playerFound
+
+
+
+
+
+
+
+
+
+
+ seek (pos)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ pos
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#seek
+
+
+
+
+
+
+
+
+
+
+ setVolume (vol)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ vol
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#setVolume
+
+
+
+
+
+
+
+
+
+
+ stop ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#stop
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.players.minplayer.html b/core/modules/file/player/doc/symbols/minplayer.players.minplayer.html
new file mode 100644
index 0000000..c640913
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.players.minplayer.html
@@ -0,0 +1,1175 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.players.minplayer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.players.minplayer
+
+
+
+
+
+ Extends
+ minplayer.display .
+
+
+ The Flash media player class to control the flash fallback.
+
+
+ Defined in: minplayer.players.minplayer.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+ Fields borrowed from class minplayer.plugin : lock , name , options , pluginReady , queue , triggered
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+ <static>
+
+ minplayer.players.minplayer.
canPlay (file)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <static>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Called when the Flash player has an update.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Methods borrowed from class minplayer.display : construct , getDisplay , getElements , getScaledRect , isValid , onResize Methods borrowed from class minplayer.plugin : addPlugin , bind , checkQueue , destroy , get , loadPlugins , ready , trigger , unbind
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.players.minplayer (context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} context
+
+
+ The jQuery context.
+
+
+ {object} options
+
+
+ This components options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ constructor
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
<static>
+
+ {boolean}
+ minplayer.players.minplayer. canPlay (file)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ file
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {boolean} If this player can play this media type.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#canPlay
+
+
+
+
+
+
+
+
+
+ {object}
+ create ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The media player entity.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#create
+
+
+
+
+
+
+
+
+
+
+ getBytesLoaded (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getBytesLoaded
+
+
+
+
+
+
+
+
+
+
+ getBytesTotal (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getBytesTotal.
+
+
+
+
+
+
+
+
+
+
+ getCurrentTime (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getCurrentTime
+
+
+
+
+
+
+
+
+
+
+ getDuration (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.flash#getDuration
+
+
+
+
+
+
+
+
<static>
+
+ {number}
+ minplayer.players.minplayer. getPriority ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {number} The priority of this media player.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getPriority
+
+
+
+
+
+
+
+
+
+
+ getVolume (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getVolume
+
+
+
+
+
+
+
+
+
+
+ load (file)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ file
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#load
+
+
+
+
+
+
+
+
+
+
+ onMediaUpdate (eventType)
+
+
+
+ Called when the Flash player has an update.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} eventType
+
+
+ The event that was triggered in the player.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pause ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#pause
+
+
+
+
+
+
+
+
+
+
+ play ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#play
+
+
+
+
+
+
+
+
+
+
+ seek (pos)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ pos
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#seek
+
+
+
+
+
+
+
+
+
+
+ setVolume (vol)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ vol
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#setVolume
+
+
+
+
+
+
+
+
+
+
+ stop ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#stop
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.players.vimeo.html b/core/modules/file/player/doc/symbols/minplayer.players.vimeo.html
new file mode 100644
index 0000000..af079a0
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.players.vimeo.html
@@ -0,0 +1,1108 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.players.vimeo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.players.vimeo
+
+
+
+
+
+ Extends
+ minplayer.players.base .
+
+
+ The vimeo media player.
+
+
+ Defined in: minplayer.players.vimeo.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+ Fields borrowed from class minplayer.players.base : mediaFile Fields borrowed from class minplayer.plugin : lock , name , options , pluginReady , queue , triggered
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+ <static>
+
+ minplayer.players.vimeo.
canPlay (file)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <static>
+
+
+ Return the ID for a provided media file.
+
+
+
+
+ <static>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Checks to see if this player can be found.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Methods borrowed from class minplayer.players.base : construct , destroy , getBytesLoaded , getBytesStart , getBytesTotal , getCurrentTime , getPlayer , hasPlayLoader , isReady , load , onComplete , onError , onLoaded , onPaused , onPlaying , onWaiting , poll , seekRelative , setVolumeRelative Methods borrowed from class minplayer.display : getDisplay , getElements , getScaledRect , isValid , onResize Methods borrowed from class minplayer.plugin : addPlugin , bind , checkQueue , get , loadPlugins , ready , trigger , unbind
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.players.vimeo (context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} context
+
+
+ The jQuery context.
+
+
+ {object} options
+
+
+ This components options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ constructor
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
<static>
+
+ {boolean}
+ minplayer.players.vimeo. canPlay (file)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ file
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {boolean} If this player can play this media type.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#canPlay
+
+
+
+
+
+
+
+
+
+ {object}
+ create ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The media player entity.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#create
+
+
+
+
+
+
+
+
+
+
+ getDuration (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getDuration.
+
+
+
+
+
+
+
+
<static>
+
+ {string}
+ minplayer.players.vimeo. getMediaId (file)
+
+
+
+ Return the ID for a provided media file.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} file
+
+
+ A minplayer.file object.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {string} The ID for the provided media.
+
+
+
+
+
+
+
+
+
+
<static>
+
+ {number}
+ minplayer.players.vimeo. getPriority ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {number} The priority of this media player.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getPriority
+
+
+
+
+
+
+
+
+
+
+ getVolume (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getVolume
+
+
+
+
+
+
+
+
+
+
+ onReady (player_id)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ player_id
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#onReady
+
+
+
+
+
+
+
+
+
+
+ pause ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#pause
+
+
+
+
+
+
+
+
+
+
+ play ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#play
+
+
+
+
+
+
+
+
+
+ {bool}
+ playerFound ()
+
+
+
+ Checks to see if this player can be found.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {bool} TRUE - Player is found, FALSE - otherwise.
+
+
+
+
+
+
+
+
+
+
+
+
+ reset ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#reset
+
+
+
+
+
+
+
+
+
+
+ seek (pos)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ pos
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#seek
+
+
+
+
+
+
+
+
+
+
+ setVolume (vol)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ vol
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#setVolume
+
+
+
+
+
+
+
+
+
+
+ stop ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#stop
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.players.youtube.html b/core/modules/file/player/doc/symbols/minplayer.players.youtube.html
new file mode 100644
index 0000000..edd94f6
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.players.youtube.html
@@ -0,0 +1,1564 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.players.youtube
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.players.youtube
+
+
+
+
+
+ Extends
+ minplayer.players.base .
+
+
+ The YouTube media player.
+
+
+ Defined in: minplayer.players.youtube.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+ The quality of the YouTube stream.
+
+
+
+
+
+
+
+
+
+ Fields borrowed from class minplayer.players.base : mediaFile Fields borrowed from class minplayer.plugin : lock , name , options , pluginReady , queue , triggered
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+ <static>
+
+ minplayer.players.youtube.
canPlay (file)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <static>
+
+
+ Return the ID for a provided media file.
+
+
+
+
+ <static>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Determines if the player should show the playloader.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Called when the player state changes.
+
+
+
+
+
+
+
+ Called when the player quality changes.
+
+
+
+
+
+
+
+ Called when an error occurs.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Checks to see if this player can be found.
+
+
+
+
+
+
+
+ Register this youtube player so that multiple players can be present
+on the same page without event collision.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Translates the player state for the YouTube API player.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Methods borrowed from class minplayer.players.base : construct , destroy , getPlayer , isReady , onComplete , onError , onLoaded , onPaused , onPlaying , onWaiting , poll , reset , seekRelative , setVolumeRelative Methods borrowed from class minplayer.display : getDisplay , getElements , getScaledRect , isValid , onResize Methods borrowed from class minplayer.plugin : addPlugin , bind , checkQueue , get , loadPlugins , ready , trigger , unbind
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.players.youtube (context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} context
+
+
+ The jQuery context.
+
+
+ {object} options
+
+
+ This components options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ constructor
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ quality
+
+
+
+ The quality of the YouTube stream.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
<static>
+
+ {boolean}
+ minplayer.players.youtube. canPlay (file)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ file
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {boolean} If this player can play this media type.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#canPlay
+
+
+
+
+
+
+
+
+
+ {object}
+ create ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The media player entity.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#create
+
+
+
+
+
+
+
+
+
+
+ getBytesLoaded (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getBytesLoaded.
+
+
+
+
+
+
+
+
+
+
+ getBytesStart (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getBytesStart.
+
+
+
+
+
+
+
+
+
+
+ getBytesTotal (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getBytesTotal.
+
+
+
+
+
+
+
+
+
+
+ getCurrentTime (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getCurrentTime
+
+
+
+
+
+
+
+
+
+
+ getDuration (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getDuration.
+
+
+
+
+
+
+
+
<static>
+
+ {string}
+ minplayer.players.youtube. getMediaId (file)
+
+
+
+ Return the ID for a provided media file.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} file
+
+
+ A minplayer.file object.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {string} The ID for the provided media.
+
+
+
+
+
+
+
+
+
+
<static>
+
+ {number}
+ minplayer.players.youtube. getPriority ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {number} The priority of this media player.
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getPriority
+
+
+
+
+
+
+
+
+
+
+ getVolume (callback)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ callback
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#getVolume
+
+
+
+
+
+
+
+
+
+ {bool}
+ hasPlayLoader ()
+
+
+
+ Determines if the player should show the playloader.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {bool} If this player implements its own playLoader.
+
+
+
+
+
+
+
+
+
+
+
+
+ load (file)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ file
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#load
+
+
+
+
+
+
+
+
+
+
+ onPlayerStateChange (event)
+
+
+
+ Called when the player state changes.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} event
+
+
+ A JavaScript Event.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onQualityChange (newQuality)
+
+
+
+ Called when the player quality changes.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} newQuality
+
+
+ The new quality for the change.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onReady (event)
+
+
+
+ Called when an error occurs.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} event
+
+
+ The onReady event that was triggered.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pause ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#pause
+
+
+
+
+
+
+
+
+
+
+ play ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#play
+
+
+
+
+
+
+
+
+
+ {bool}
+ playerFound ()
+
+
+
+ Checks to see if this player can be found.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {bool} TRUE - Player is found, FALSE - otherwise.
+
+
+
+
+
+
+
+
+
+
+
+
+ register ()
+
+
+
+ Register this youtube player so that multiple players can be present
+on the same page without event collision.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ seek (pos)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ pos
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#seek
+
+
+
+
+
+
+
+
+
+
+ setPlayerState (playerState)
+
+
+
+ Translates the player state for the YouTube API player.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {number} playerState
+
+
+ The YouTube player state.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setVolume (vol)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ vol
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#setVolume
+
+
+
+
+
+
+
+
+
+
+ stop ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.players.base#stop
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.plugin.html b/core/modules/file/player/doc/symbols/minplayer.plugin.html
new file mode 100644
index 0000000..45d2ade
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.plugin.html
@@ -0,0 +1,1055 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.plugin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.plugin
+
+
+
+
+
+
+
+ The base class for all plugins.
+
+
+ Defined in: minplayer.plugin.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Create a queue lock.
+
+
+
+
+
+
+
+ The name of this plugin.
+
+
+
+
+
+
+
+ The options for this plugin.
+
+
+
+
+
+
+
+ The ready flag.
+
+
+
+
+
+
+
+ The event queue.
+
+
+
+
+
+
+
+ Keep track of already triggered events.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+
+
+
+ Adds a new plugin to this player.
+
+
+
+
+
+
+
+ Bind to a media event.
+
+
+
+
+
+
+
+ Check the queue and execute it.
+
+
+
+
+
+
+
+ The constructor which is called once the context is set.
+
+
+
+
+
+
+
+ Destructor.
+
+
+
+
+
+
+
+ Gets a plugin by name and calls callback when it is ready.
+
+
+
+
+
+
+
+ Loads all of the available plugins.
+
+
+
+
+
+
+
+ Plugins should call this method when they are ready.
+
+
+
+
+
+
+
+ Trigger a media event.
+
+
+
+
+
+
+
+ Unbind a media event.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.plugin (name, context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} name
+
+
+ The name of this plugin.
+
+
+ {object} context
+
+
+ The jQuery context.
+
+
+ {object} options
+
+
+ This components options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ lock
+
+
+
+ Create a queue lock.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ name
+
+
+
+ The name of this plugin.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ options
+
+
+
+ The options for this plugin.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pluginReady
+
+
+
+ The ready flag.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ queue
+
+
+
+ The event queue.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ triggered
+
+
+
+ Keep track of already triggered events.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+ addPlugin (name, plugin)
+
+
+
+ Adds a new plugin to this player.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} name
+
+
+ The name of this plugin.
+
+
+ {object} plugin
+
+
+ A new plugin object, derived from media.plugin.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {object}
+ bind (type, data, fn)
+
+
+
+ Bind to a media event.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} type
+
+
+ The event type.
+
+
+ {object} data
+
+
+ The data to bind with the event.
+
+
+ {function} fn
+
+
+ The callback function.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The plugin object.
+
+
+
+
+
+
+
+
+
+
+
+
+ checkQueue ()
+
+
+
+ Check the queue and execute it.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ construct ()
+
+
+
+ The constructor which is called once the context is set.
+Any class deriving from the plugin class should place all context
+dependant functionality within this function instead of the standard
+constructor function since it is called on object derivation as well
+as object creation.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ destroy ()
+
+
+
+ Destructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {object}
+ get (plugin, callback)
+
+
+
+ Gets a plugin by name and calls callback when it is ready.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} plugin
+
+
+ The plugin of the plugin.
+
+
+ {function} callback
+
+
+ Called when the plugin is ready.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The plugin if no callback is provided.
+
+
+
+
+
+
+
+
+
+
+
+
+ loadPlugins ()
+
+
+
+ Loads all of the available plugins.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ready ()
+
+
+
+ Plugins should call this method when they are ready.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {object}
+ trigger (type, data)
+
+
+
+ Trigger a media event.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} type
+
+
+ The event type.
+
+
+ {object} data
+
+
+ The event data object.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The plugin object.
+
+
+
+
+
+
+
+
+
+
+
+ {object}
+ unbind (type, fn)
+
+
+
+ Unbind a media event.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {string} type
+
+
+ The event type.
+
+
+ {function} fn
+
+
+ The callback function.
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The plugin object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Tue Feb 28 2012 09:22:57 GMT-0800 (PST)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/minplayer.templates.base.html b/core/modules/file/player/doc/symbols/minplayer.templates.base.html
new file mode 100644
index 0000000..bcdbc0f
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/minplayer.templates.base.html
@@ -0,0 +1,572 @@
+
+
+
+
+
+
+ JsDoc Reference - minplayer.templates.base
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class minplayer.templates.base
+
+
+
+
+
+ Extends
+ minplayer.display .
+
+
+ The base template class which all templates should derive.
+
+
+ Defined in: minplayer.templates.base.js .
+
+
+
+
+
+
+ Class Summary
+
+
+ Constructor Attributes
+ Constructor Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+ Field Attributes
+ Field Name and Description
+
+
+
+
+
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+ Method Attributes
+ Method Name and Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Called when the media player goes into full screen mode.
+
+
+
+
+
+
+
+
+
+ Methods borrowed from class minplayer.display : bind , getScaledRect , isValid , onResize , trigger Methods borrowed from class minplayer.plugin : addPlugin , destroy , eachPlugin , getPlugin , getPlugins , initialize , loading , loadPlugins , ready , setLoading
+
+
+
+
+
+
+
+
+
+
+ Class Detail
+
+
+
+ minplayer.templates.base (context, options)
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {object} context
+
+
+ The jQuery context.
+
+
+ {object} options
+
+
+ This components options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+ constructor
+
+
+
+ Reset the constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+ construct ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See:
+
+ minplayer.plugin#construct
+
+
+
+
+
+
+
+
+
+ {object}
+ getElements ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+ {object} The display elemnents for this component.
+
+
+
+
+
+
+ See:
+
+ minplayer.display#getElements
+
+
+
+
+
+
+
+
+
+
+ onFullScreen (full)
+
+
+
+ Called when the media player goes into full screen mode.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+ {boolean} full
+
+
+ TRUE - The player is in fullscreen, FALSE otherwise.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation generated by
JsDoc Toolkit 2.4.0 on Sat Feb 11 2012 02:41:00 GMT+0100 (CET)
+
+
+
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.async.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.async.js.html
new file mode 100644
index 0000000..dc69872
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.async.js.html
@@ -0,0 +1,69 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /**
+ 5 * @constructor
+ 6 * @class This class keeps track of asynchronous get requests for certain
+ 7 * variables within the player.
+ 8 */
+ 9 minplayer.async = function ( ) {
+ 10
+ 11 /** The final value of this asynchronous variable. */
+ 12 this.value = null ;
+ 13
+ 14 /** The queue of callbacks to call when this value is determined. */
+ 15 this.queue = [ ] ;
+ 16 } ;
+ 17
+ 18 /**
+ 19 * Retrieve the value of this variable.
+ 20 *
+ 21 * @param {function} callback The function to call when the value is determined.
+ 22 * @param {function} pollValue The poll function to try and get the value every
+ 23 * 1 second if the value is not set.
+ 24 */
+ 25 minplayer.async.prototype.get = function ( callback , pollValue ) {
+ 26
+ 27 // If the value is set, then immediately call the callback, otherwise, just
+ 28 // add it to the queue when the variable is set.
+ 29 if ( this.value !== null ) {
+ 30 callback ( this.value ) ;
+ 31 }
+ 32 else {
+ 33
+ 34 // Add this callback to the queue.
+ 35 this.queue.push ( callback ) ;
+ 36 }
+ 37 } ;
+ 38
+ 39 /**
+ 40 * Sets the value of an asynchronous value.
+ 41 *
+ 42 * @param {void} val The value to set.
+ 43 */
+ 44 minplayer.async.prototype.set = function ( val ) {
+ 45
+ 46 // Set the value.
+ 47 this.value = val ;
+ 48
+ 49 // Get the callback queue length.
+ 50 var i = this.queue.length ;
+ 51
+ 52 // Iterate through all the callbacks and call them.
+ 53 if ( i ) {
+ 54 while ( i -- ) {
+ 55 this.queue [ i ] ( val ) ;
+ 56 }
+ 57
+ 58 // Reset the queue.
+ 59 this.queue = [ ] ;
+ 60 }
+ 61 } ;
+ 62
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.compatibility.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.compatibility.js.html
new file mode 100644
index 0000000..8cbb698
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.compatibility.js.html
@@ -0,0 +1,109 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 // Private function to check a single element's play type.
+ 5 function checkPlayType ( elem , playType ) {
+ 6 if ( ( typeof elem.canPlayType ) === 'function' ) {
+ 7 if ( typeof playType === 'object' ) {
+ 8 var i = playType.length ;
+ 9 var mimetype = '' ;
+ 10 while ( i -- ) {
+ 11 mimetype = checkPlayType ( elem , playType [ i ] ) ;
+ 12 if ( ! ! mimetype ) {
+ 13 break ;
+ 14 }
+ 15 }
+ 16 return mimetype ;
+ 17 }
+ 18 else {
+ 19 var canPlay = elem.canPlayType ( playType ) ;
+ 20 if ( ( 'no' !== canPlay ) && ( '' !== canPlay ) ) {
+ 21 return playType ;
+ 22 }
+ 23 }
+ 24 }
+ 25 return '' ;
+ 26 }
+ 27
+ 28 /**
+ 29 * @constructor
+ 30 * @class This class is used to define the types of media that can be played
+ 31 * within the browser.
+ 32 * <p>
+ 33 * <strong>Usage:</strong>
+ 34 * <pre><code>
+ 35 * var playTypes = new minplayer.compatibility();
+ 36 *
+ 37 * if (playTypes.videoOGG) {
+ 38 * console.log("This browser can play OGG video");
+ 39 * }
+ 40 *
+ 41 * if (playTypes.videoH264) {
+ 42 * console.log("This browser can play H264 video");
+ 43 * }
+ 44 *
+ 45 * if (playTypes.videoWEBM) {
+ 46 * console.log("This browser can play WebM video");
+ 47 * }
+ 48 *
+ 49 * if (playTypes.audioOGG) {
+ 50 * console.log("This browser can play OGG audio");
+ 51 * }
+ 52 *
+ 53 * if (playTypes.audioMP3) {
+ 54 * console.log("This browser can play MP3 audio");
+ 55 * }
+ 56 *
+ 57 * if (playTypes.audioMP4) {
+ 58 * console.log("This browser can play MP4 audio");
+ 59 * }
+ 60 * </code></pre>
+ 61 */
+ 62 minplayer.compatibility = function ( ) {
+ 63 var elem = null ;
+ 64
+ 65 // Create a video element.
+ 66 elem = document.createElement ( 'video' ) ;
+ 67
+ 68 /** Can play OGG video */
+ 69 this.videoOGG = checkPlayType ( elem , 'video/ogg' ) ;
+ 70
+ 71 /** Can play H264 video */
+ 72 this.videoH264 = checkPlayType ( elem , [
+ 73 'video/mp4' ,
+ 74 'video/h264'
+ 75 ] ) ;
+ 76
+ 77 /** Can play WEBM video */
+ 78 this.videoWEBM = checkPlayType ( elem , [
+ 79 'video/x-webm' ,
+ 80 'video/webm' ,
+ 81 'application/octet-stream'
+ 82 ] ) ;
+ 83
+ 84 // Create an audio element.
+ 85 elem = document.createElement ( 'audio' ) ;
+ 86
+ 87 /** Can play audio OGG */
+ 88 this.audioOGG = checkPlayType ( elem , 'audio/ogg' ) ;
+ 89
+ 90 /** Can play audio MP3 */
+ 91 this.audioMP3 = checkPlayType ( elem , 'audio/mpeg' ) ;
+ 92
+ 93 /** Can play audio MP4 */
+ 94 this.audioMP4 = checkPlayType ( elem , 'audio/mp4' ) ;
+ 95 } ;
+ 96
+ 97 if ( ! minplayer.playTypes ) {
+ 98
+ 99 /** The compatible playtypes for this browser. */
+100 minplayer.playTypes = new minplayer.compatibility ( ) ;
+101 }
+102
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.controller.base.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.controller.base.js.html
new file mode 100644
index 0000000..5fba3dc
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.controller.base.js.html
@@ -0,0 +1,303 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /** Define the controller object. */
+ 5 minplayer.controller = minplayer.controller || { } ;
+ 6
+ 7 /**
+ 8 * @constructor
+ 9 * @extends minplayer.display
+ 10 * @class This is the base minplayer controller. Other controllers can derive
+ 11 * from the base and either build on top of it or simply define the elements
+ 12 * that this base controller uses.
+ 13 *
+ 14 * @param {object} context The jQuery context.
+ 15 * @param {object} options This components options.
+ 16 */
+ 17 minplayer.controller.base = function ( context , options ) {
+ 18
+ 19 // Derive from display
+ 20 minplayer.display.call ( this , 'controller' , context , options ) ;
+ 21 } ;
+ 22
+ 23 // Define the prototype for all controllers.
+ 24 var controllersBase = minplayer.controller.base ;
+ 25
+ 26 /** Derive from minplayer.display. */
+ 27 minplayer.controller.base.prototype = new minplayer.display ( ) ;
+ 28
+ 29 /** Reset the constructor. */
+ 30 minplayer.controller.base.prototype.constructor = minplayer.controller.base ;
+ 31
+ 32 /**
+ 33 * A static function that will format a time value into a string time format.
+ 34 *
+ 35 * @param {integer} time An integer value of time.
+ 36 * @return {string} A string representation of the time.
+ 37 */
+ 38 minplayer.formatTime = function ( time ) {
+ 39 time = time || 0 ;
+ 40 var seconds = 0 , minutes = 0 , hour = 0 , timeString = '' ;
+ 41
+ 42 hour = Math.floor ( time / 3600 ) ;
+ 43 time - = ( hour * 3600 ) ;
+ 44 minutes = Math.floor ( time / 60 ) ;
+ 45 time - = ( minutes * 60 ) ;
+ 46 seconds = Math.floor ( time % 60 ) ;
+ 47
+ 48 if ( hour ) {
+ 49 timeString + = String ( hour ) ;
+ 50 timeString + = ':' ;
+ 51 }
+ 52
+ 53 timeString + = ( minutes >= 10 ) ? String ( minutes ) : ( '0' + String ( minutes ) ) ;
+ 54 timeString + = ':' ;
+ 55 timeString + = ( seconds >= 10 ) ? String ( seconds ) : ( '0' + String ( seconds ) ) ;
+ 56 return { time : timeString , units : '' } ;
+ 57 } ;
+ 58
+ 59 /**
+ 60 * @see minplayer.display#getElements
+ 61 * @return {object} The elements defined by this display.
+ 62 */
+ 63 minplayer.controller.base.prototype.getElements = function ( ) {
+ 64 var elements = minplayer.display.prototype.getElements.call ( this ) ;
+ 65 return jQuery.extend ( elements , {
+ 66 play : null ,
+ 67 pause : null ,
+ 68 fullscreen : null ,
+ 69 seek : null ,
+ 70 progress : null ,
+ 71 volume : null ,
+ 72 timer : null
+ 73 } ) ;
+ 74 } ;
+ 75
+ 76 /**
+ 77 * @see minplayer.plugin#construct
+ 78 */
+ 79 minplayer.controller.base.prototype.construct = function ( ) {
+ 80
+ 81 // Call the minplayer plugin constructor.
+ 82 minplayer.display.prototype.construct.call ( this ) ;
+ 83
+ 84 // If they have a fullscreen button.
+ 85 if ( this.elements.fullscreen ) {
+ 86
+ 87 // Bind to the click event.
+ 88 this.elements.fullscreen.bind ( 'click' , { obj : this } , function ( event ) {
+ 89 var isFull = event.data.obj.elements.player.hasClass ( 'fullscreen' ) ;
+ 90 if ( isFull ) {
+ 91 event.data.obj.elements.player.removeClass ( 'fullscreen' ) ;
+ 92 }
+ 93 else {
+ 94 event.data.obj.elements.player.addClass ( 'fullscreen' ) ;
+ 95 }
+ 96 event.data.obj.trigger ( 'fullscreen' , ! isFull ) ;
+ 97 } ) . css ( { 'pointer' : 'hand' } ) ;
+ 98 }
+ 99
+100 // Keep track of if we are dragging...
+101 this.dragging = false ;
+102
+103 // If they have a seek bar.
+104 if ( this.elements.seek ) {
+105
+106 // Create the seek bar slider control.
+107 this.seekBar = this.elements.seek.slider ( {
+108 range : 'min'
+109 } ) ;
+110 }
+111
+112 // If they have a volume bar.
+113 if ( this.elements.volume ) {
+114
+115 // Create the volume bar slider control.
+116 this.volumeBar = this.elements.volume.slider ( {
+117 range : 'min' ,
+118 orientation : 'vertical'
+119 } ) ;
+120 }
+121
+122 // Get the media plugin.
+123 this.get ( 'media' , function ( media ) {
+124
+125 var _this = this ;
+126
+127 // If they have a pause button
+128 if ( this.elements.pause ) {
+129
+130 // Bind to the click on this button.
+131 this.elements.pause.unbind ( ) . bind ( 'click' , { obj : this } , function ( event ) {
+132 event.preventDefault ( ) ;
+133 event.data.obj.playPause ( false , media ) ;
+134 } ) ;
+135
+136 // Bind to the pause event of the media.
+137 media.bind ( 'pause' , { obj : this } , function ( event ) {
+138 event.data.obj.setPlayPause ( true ) ;
+139 } ) ;
+140 }
+141
+142 // If they have a play button
+143 if ( this.elements.play ) {
+144
+145 // Bind to the click on this button.
+146 this.elements.play.unbind ( ) . bind ( 'click' , { obj : this } , function ( event ) {
+147 event.preventDefault ( ) ;
+148 event.data.obj.playPause ( true , media ) ;
+149 } ) ;
+150
+151 // Bind to the play event of the media.
+152 media.bind ( 'playing' , { obj : this } , function ( event ) {
+153 event.data.obj.setPlayPause ( false ) ;
+154 } ) ;
+155 }
+156
+157 // If they have a duration, then trigger on duration change.
+158 if ( this.elements.duration ) {
+159
+160 // Bind to the duration change event.
+161 media.bind ( 'durationchange' , { obj : this } , function ( event , data ) {
+162 event.data.obj.setTimeString ( 'duration' , data.duration ) ;
+163 } ) ;
+164
+165 // Set the timestring to the duration.
+166 media.getDuration ( function ( duration ) {
+167 _this.setTimeString ( 'duration' , duration ) ;
+168 } ) ;
+169 }
+170
+171 // If they have a progress element.
+172 if ( this.elements.progress ) {
+173
+174 // Bind to the progress event.
+175 media.bind ( 'progress' , { obj : this } , function ( event , data ) {
+176 var percent = data.total ? ( data.loaded / data.total ) * 100 : 0 ;
+177 event.data.obj.elements.progress.width ( percent + '%' ) ;
+178 } ) ;
+179 }
+180
+181 // If they have a seek bar or timer, bind to the timeupdate.
+182 if ( this.seekBar || this.elements.timer ) {
+183
+184 // Bind to the time update event.
+185 media.bind ( 'timeupdate' , { obj : this } , function ( event , data ) {
+186 if ( ! event.data.obj.dragging ) {
+187 var value = 0 ;
+188 if ( data.duration ) {
+189 value = ( data.currentTime / data.duration ) * 100 ;
+190 }
+191
+192 // Update the seek bar if it exists.
+193 if ( event.data.obj.seekBar ) {
+194 event.data.obj.seekBar.slider ( 'option' , 'value' , value ) ;
+195 }
+196
+197 event.data.obj.setTimeString ( 'timer' , data.currentTime ) ;
+198 }
+199 } ) ;
+200 }
+201
+202 // If they have a seekBar element.
+203 if ( this.seekBar ) {
+204
+205 // Register the events for the control bar to control the media.
+206 this.seekBar.slider ( {
+207 start : function ( event , ui ) {
+208 _this.dragging = true ;
+209 } ,
+210 stop : function ( event , ui ) {
+211 _this.dragging = false ;
+212 media.getDuration ( function ( duration ) {
+213 media.seek ( ( ui.value / 100 ) * duration ) ;
+214 } ) ;
+215 } ,
+216 slide : function ( event , ui ) {
+217 media.getDuration ( function ( duration ) {
+218 var time = ( ui.value / 100 ) * duration ;
+219 if ( ! _this.dragging ) {
+220 media.seek ( time ) ;
+221 }
+222 _this.setTimeString ( 'timer' , time ) ;
+223 } ) ;
+224 }
+225 } ) ;
+226 }
+227
+228 // Setup the volume bar.
+229 if ( this.volumeBar ) {
+230
+231 // Create the slider.
+232 this.volumeBar.slider ( {
+233 slide : function ( event , ui ) {
+234 media.setVolume ( ui.value / 100 ) ;
+235 }
+236 } ) ;
+237
+238 media.bind ( 'volumeupdate' , { obj : this } , function ( event , vol ) {
+239 event.data.obj.volumeBar.slider ( 'option' , 'value' , ( vol * 100 ) ) ;
+240 } ) ;
+241
+242 // Set the volume to match that of the player.
+243 media.getVolume ( function ( vol ) {
+244 _this.volumeBar.slider ( 'option' , 'value' , ( vol * 100 ) ) ;
+245 } ) ;
+246 }
+247 } ) ;
+248
+249 // We are now ready.
+250 this.ready ( ) ;
+251 } ;
+252
+253 /**
+254 * Sets the play and pause state of the control bar.
+255 *
+256 * @param {boolean} state TRUE - Show Play, FALSE - Show Pause.
+257 */
+258 minplayer.controller.base.prototype.setPlayPause = function ( state ) {
+259 var css = '' ;
+260 if ( this.elements.play ) {
+261 css = state ? 'inherit' : 'none' ;
+262 this.elements.play.css ( 'display' , css ) ;
+263 }
+264 if ( this.elements.pause ) {
+265 css = state ? 'none' : 'inherit' ;
+266 this.elements.pause.css ( 'display' , css ) ;
+267 }
+268 } ;
+269
+270 /**
+271 * Plays or pauses the media.
+272 *
+273 * @param {bool} state true => play, false => pause.
+274 * @param {object} media The media player object.
+275 */
+276 minplayer.controller.base.prototype.playPause = function ( state , media ) {
+277 var type = state ? 'play' : 'pause' ;
+278 this.display.trigger ( type ) ;
+279 this.setPlayPause ( ! state ) ;
+280 if ( media ) {
+281 media [ type ] ( ) ;
+282 }
+283 } ;
+284
+285 /**
+286 * Sets the time string on the control bar.
+287 *
+288 * @param {string} element The name of the element to set.
+289 * @param {number} time The total time amount to set.
+290 */
+291 minplayer.controller.base.prototype.setTimeString = function ( element , time ) {
+292 if ( this.elements [ element ] ) {
+293 this.elements [ element ] . text ( minplayer.formatTime ( time ) . time ) ;
+294 }
+295 } ;
+296
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.controllers.base.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.controllers.base.js.html
new file mode 100644
index 0000000..d653325
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.controllers.base.js.html
@@ -0,0 +1,299 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /** Define the controllers object. */
+ 5 minplayer.controllers = minplayer.controllers || { } ;
+ 6
+ 7 /**
+ 8 * @constructor
+ 9 * @extends minplayer.display
+ 10 * @class This is the base minplayer controller. Other controllers can derive
+ 11 * from the base and either build on top of it or simply define the elements
+ 12 * that this base controller uses.
+ 13 *
+ 14 * @param {object} context The jQuery context.
+ 15 * @param {object} options This components options.
+ 16 */
+ 17 minplayer.controllers.base = function ( context , options ) {
+ 18
+ 19 // Derive from display
+ 20 minplayer.display.call ( this , 'controller' , context , options ) ;
+ 21 } ;
+ 22
+ 23 // Define the prototype for all controllers.
+ 24 var controllersBase = minplayer.controllers.base ;
+ 25
+ 26 /** Derive from minplayer.display. */
+ 27 minplayer.controllers.base.prototype = new minplayer.display ( ) ;
+ 28
+ 29 /** Reset the constructor. */
+ 30 minplayer.controllers.base.prototype.constructor = minplayer.controllers.base ;
+ 31
+ 32 /**
+ 33 * A static function that will format a time value into a string time format.
+ 34 *
+ 35 * @param {integer} time An integer value of time.
+ 36 * @return {string} A string representation of the time.
+ 37 */
+ 38 minplayer.formatTime = function ( time ) {
+ 39 time = time || 0 ;
+ 40 var seconds = 0 , minutes = 0 , hour = 0 , timeString = '' ;
+ 41
+ 42 hour = Math.floor ( time / 3600 ) ;
+ 43 time - = ( hour * 3600 ) ;
+ 44 minutes = Math.floor ( time / 60 ) ;
+ 45 time - = ( minutes * 60 ) ;
+ 46 seconds = Math.floor ( time % 60 ) ;
+ 47
+ 48 if ( hour ) {
+ 49 timeString + = String ( hour ) ;
+ 50 timeString + = ':' ;
+ 51 }
+ 52
+ 53 timeString + = ( minutes >= 10 ) ? String ( minutes ) : ( '0' + String ( minutes ) ) ;
+ 54 timeString + = ':' ;
+ 55 timeString + = ( seconds >= 10 ) ? String ( seconds ) : ( '0' + String ( seconds ) ) ;
+ 56 return { time : timeString , units : '' } ;
+ 57 } ;
+ 58
+ 59 /**
+ 60 * @see minplayer.display#getElements
+ 61 * @return {object} The elements defined by this display.
+ 62 */
+ 63 minplayer.controllers.base.prototype.getElements = function ( ) {
+ 64 var elements = minplayer.display.prototype.getElements.call ( this ) ;
+ 65 return jQuery.extend ( elements , {
+ 66 play : null ,
+ 67 pause : null ,
+ 68 fullscreen : null ,
+ 69 seek : null ,
+ 70 progress : null ,
+ 71 volume : null ,
+ 72 timer : null
+ 73 } ) ;
+ 74 } ;
+ 75
+ 76 /**
+ 77 * @see minplayer.plugin#construct
+ 78 */
+ 79 minplayer.controllers.base.prototype.construct = function ( ) {
+ 80
+ 81 // Call the minplayer plugin constructor.
+ 82 minplayer.display.prototype.construct.call ( this ) ;
+ 83
+ 84 // If they have a fullscreen button.
+ 85 if ( this.elements.fullscreen ) {
+ 86
+ 87 // Bind to the click event.
+ 88 this.elements.fullscreen.bind ( 'click' , { obj : this } , function ( event ) {
+ 89 var isFull = event.data.obj.elements.player.hasClass ( 'fullscreen' ) ;
+ 90 if ( isFull ) {
+ 91 event.data.obj.elements.player.removeClass ( 'fullscreen' ) ;
+ 92 }
+ 93 else {
+ 94 event.data.obj.elements.player.addClass ( 'fullscreen' ) ;
+ 95 }
+ 96 event.data.obj.trigger ( 'fullscreen' , ! isFull ) ;
+ 97 } ) . css ( { 'pointer' : 'hand' } ) ;
+ 98 }
+ 99
+100 // Keep track of if we are dragging...
+101 this.dragging = false ;
+102
+103 // If they have a seek bar.
+104 if ( this.elements.seek ) {
+105
+106 // Create the seek bar slider control.
+107 this.seekBar = this.elements.seek.slider ( {
+108 range : 'min'
+109 } ) ;
+110 }
+111
+112 // If they have a volume bar.
+113 if ( this.elements.volume ) {
+114
+115 // Create the volume bar slider control.
+116 this.volumeBar = this.elements.volume.slider ( {
+117 range : 'min' ,
+118 orientation : 'vertical'
+119 } ) ;
+120 }
+121
+122 // Get the media plugin.
+123 this.get ( 'media' , function ( media ) {
+124
+125 var _this = this ;
+126
+127 // If they have a pause button
+128 if ( this.elements.pause ) {
+129
+130 // Bind to the click on this button.
+131 this.elements.pause.bind ( 'click' , { obj : this } , function ( event ) {
+132 event.preventDefault ( ) ;
+133 event.data.obj.playPause ( false , media ) ;
+134 } ) ;
+135
+136 // Bind to the pause event of the media.
+137 media.bind ( 'pause' , { obj : this } , function ( event ) {
+138 event.data.obj.setPlayPause ( true ) ;
+139 } ) ;
+140 }
+141
+142 // If they have a play button
+143 if ( this.elements.play ) {
+144
+145 // Bind to the click on this button.
+146 this.elements.play.bind ( 'click' , { obj : this } , function ( event ) {
+147 event.preventDefault ( ) ;
+148 event.data.obj.playPause ( true , media ) ;
+149 } ) ;
+150
+151 // Bind to the play event of the media.
+152 media.bind ( 'playing' , { obj : this } , function ( event ) {
+153 event.data.obj.setPlayPause ( false ) ;
+154 } ) ;
+155 }
+156
+157 // If they have a duration, then trigger on duration change.
+158 if ( this.elements.duration ) {
+159
+160 // Bind to the duration change event.
+161 media.bind ( 'durationchange' , { obj : this } , function ( event , data ) {
+162 event.data.obj.setTimeString ( 'duration' , data.duration ) ;
+163 } ) ;
+164
+165 // Set the timestring to the duration.
+166 media.getDuration ( function ( duration ) {
+167 _this.setTimeString ( 'duration' , duration ) ;
+168 } ) ;
+169 }
+170
+171 // If they have a progress element.
+172 if ( this.elements.progress ) {
+173
+174 // Bind to the progress event.
+175 media.bind ( 'progress' , { obj : this } , function ( event , data ) {
+176 var percent = data.total ? ( data.loaded / data.total ) * 100 : 0 ;
+177 event.data.obj.elements.progress.width ( percent + '%' ) ;
+178 } ) ;
+179 }
+180
+181 // If they have a seek bar or timer, bind to the timeupdate.
+182 if ( this.seekBar || this.elements.timer ) {
+183
+184 // Bind to the time update event.
+185 media.bind ( 'timeupdate' , { obj : this } , function ( event , data ) {
+186 if ( ! event.data.obj.dragging ) {
+187 var value = 0 ;
+188 if ( data.duration ) {
+189 value = ( data.currentTime / data.duration ) * 100 ;
+190 }
+191
+192 // Update the seek bar if it exists.
+193 if ( event.data.obj.seekBar ) {
+194 event.data.obj.seekBar.slider ( 'option' , 'value' , value ) ;
+195 }
+196
+197 event.data.obj.setTimeString ( 'timer' , data.currentTime ) ;
+198 }
+199 } ) ;
+200 }
+201
+202 // If they have a seekBar element.
+203 if ( this.seekBar ) {
+204
+205 // Register the events for the control bar to control the media.
+206 this.seekBar.slider ( {
+207 start : function ( event , ui ) {
+208 _this.dragging = true ;
+209 } ,
+210 stop : function ( event , ui ) {
+211 _this.dragging = false ;
+212 media.getDuration ( function ( duration ) {
+213 media.seek ( ( ui.value / 100 ) * duration ) ;
+214 } ) ;
+215 } ,
+216 slide : function ( event , ui ) {
+217 media.getDuration ( function ( duration ) {
+218 var time = ( ui.value / 100 ) * duration ;
+219 if ( ! _this.dragging ) {
+220 media.seek ( time ) ;
+221 }
+222 _this.setTimeString ( 'timer' , time ) ;
+223 } ) ;
+224 }
+225 } ) ;
+226 }
+227
+228 // Setup the volume bar.
+229 if ( this.volumeBar ) {
+230
+231 // Create the slider.
+232 this.volumeBar.slider ( {
+233 slide : function ( event , ui ) {
+234 media.setVolume ( ui.value / 100 ) ;
+235 }
+236 } ) ;
+237
+238 // Set the volume to match that of the player.
+239 media.getVolume ( function ( vol ) {
+240 _this.volumeBar.slider ( 'option' , 'value' , ( vol * 100 ) ) ;
+241 } ) ;
+242 }
+243 } ) ;
+244
+245 // We are now ready.
+246 this.ready ( ) ;
+247 } ;
+248
+249 /**
+250 * Sets the play and pause state of the control bar.
+251 *
+252 * @param {boolean} state TRUE - Show Play, FALSE - Show Pause.
+253 */
+254 minplayer.controllers.base.prototype.setPlayPause = function ( state ) {
+255 var css = '' ;
+256 if ( this.elements.play ) {
+257 css = state ? 'inherit' : 'none' ;
+258 this.elements.play.css ( 'display' , css ) ;
+259 }
+260 if ( this.elements.pause ) {
+261 css = state ? 'none' : 'inherit' ;
+262 this.elements.pause.css ( 'display' , css ) ;
+263 }
+264 } ;
+265
+266 /**
+267 * Plays or pauses the media.
+268 *
+269 * @param {bool} state true => play, false => pause.
+270 * @param {object} media The media player object.
+271 */
+272 minplayer.controllers.base.prototype.playPause = function ( state , media ) {
+273 var type = state ? 'play' : 'pause' ;
+274 this.display.trigger ( type ) ;
+275 this.setPlayPause ( ! state ) ;
+276 if ( media ) {
+277 media [ type ] ( ) ;
+278 }
+279 } ;
+280
+281 /**
+282 * Sets the time string on the control bar.
+283 *
+284 * @param {string} element The name of the element to set.
+285 * @param {number} time The total time amount to set.
+286 */
+287 minplayer.controllers.base.prototype.setTimeString = function ( element , time ) {
+288 if ( this.elements [ element ] ) {
+289 this.elements [ element ] . text ( minplayer.formatTime ( time ) . time ) ;
+290 }
+291 } ;
+292
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.display.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.display.js.html
new file mode 100644
index 0000000..408e819
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.display.js.html
@@ -0,0 +1,136 @@
+ 1 /** The minplayer namespace. */
+ 2 minplayer = minplayer || { } ;
+ 3
+ 4 /**
+ 5 * @constructor
+ 6 * @extends minplayer.plugin
+ 7 * @class Base class used to provide the display and options for any component
+ 8 * deriving from this class. Components who derive are expected to provide
+ 9 * the elements that they define by implementing the getElements method.
+ 10 *
+ 11 * @param {string} name The name of this plugin.
+ 12 * @param {object} context The jQuery context this component resides.
+ 13 * @param {object} options The options for this component.
+ 14 */
+ 15 minplayer.display = function ( name , context , options ) {
+ 16
+ 17 // See if we allow resize on this display.
+ 18 this.allowResize = false ;
+ 19
+ 20 if ( context ) {
+ 21
+ 22 // Set the display.
+ 23 this.display = this.getDisplay ( context , options ) ;
+ 24 }
+ 25
+ 26 // Derive from plugin
+ 27 minplayer.plugin.call ( this , name , context , options ) ;
+ 28 } ;
+ 29
+ 30 /** Derive from minplayer.plugin. */
+ 31 minplayer.display.prototype = new minplayer.plugin ( ) ;
+ 32
+ 33 /** Reset the constructor. */
+ 34 minplayer.display.prototype.constructor = minplayer.display ;
+ 35
+ 36 /**
+ 37 * Returns the display for this component.
+ 38 *
+ 39 * @param {object} context The original context.
+ 40 * @param {object} options The options for this component.
+ 41 * @return {object} The jQuery context for this display.
+ 42 */
+ 43 minplayer.display.prototype.getDisplay = function ( context , options ) {
+ 44 return jQuery ( context ) ;
+ 45 } ;
+ 46
+ 47 /**
+ 48 * @see minplayer.plugin.construct
+ 49 */
+ 50 minplayer.display.prototype.construct = function ( ) {
+ 51
+ 52 // Call the plugin constructor.
+ 53 minplayer.plugin.prototype.construct.call ( this ) ;
+ 54
+ 55 // Extend all display elements.
+ 56 this.options.elements = this.options.elements || { } ;
+ 57 jQuery.extend ( this.options.elements , this.getElements ( ) ) ;
+ 58 this.elements = this.options.elements ;
+ 59
+ 60 // Only do this if they allow resize for this display.
+ 61 if ( this.allowResize ) {
+ 62
+ 63 // Set the resize timeout and this pointer.
+ 64 var resizeTimeout = 0 ;
+ 65 var _this = this ;
+ 66
+ 67 // Add a handler to trigger a resize event.
+ 68 jQuery ( window ) . resize ( function ( ) {
+ 69 clearTimeout ( resizeTimeout ) ;
+ 70 resizeTimeout = setTimeout ( function ( ) {
+ 71 _this.onResize ( ) ;
+ 72 } , 200 ) ;
+ 73 } ) ;
+ 74 }
+ 75 } ;
+ 76
+ 77 /**
+ 78 * Called when the window resizes.
+ 79 */
+ 80 minplayer.display.prototype.onResize = function ( ) {
+ 81 } ;
+ 82
+ 83 /**
+ 84 * Returns a scaled rectangle provided a ratio and the container rect.
+ 85 *
+ 86 * @param {number} ratio The width/height ratio of what is being scaled.
+ 87 * @param {object} rect The bounding rectangle for scaling.
+ 88 * @return {object} The Rectangle object of the scaled rectangle.
+ 89 */
+ 90 minplayer.display.prototype.getScaledRect = function ( ratio , rect ) {
+ 91 var scaledRect = { } ;
+ 92 scaledRect.x = rect.x ? rect.x : 0 ;
+ 93 scaledRect.y = rect.y ? rect.y : 0 ;
+ 94 scaledRect.width = rect.width ? rect.width : 0 ;
+ 95 scaledRect.height = rect.height ? rect.height : 0 ;
+ 96 if ( ratio ) {
+ 97 if ( ( rect.width / rect.height ) > ratio ) {
+ 98 scaledRect.height = rect.height ;
+ 99 scaledRect.width = Math.floor ( rect.height * ratio ) ;
+100 }
+101 else {
+102 scaledRect.height = Math.floor ( rect.width / ratio ) ;
+103 scaledRect.width = rect.width ;
+104 }
+105 scaledRect.x = Math.floor ( ( rect.width - scaledRect.width ) / 2 ) ;
+106 scaledRect.y = Math.floor ( ( rect.height - scaledRect.height ) / 2 ) ;
+107 }
+108 return scaledRect ;
+109 } ;
+110
+111 /**
+112 * Returns all the jQuery elements that this component uses.
+113 *
+114 * @return {object} An object which defines all the jQuery elements that
+115 * this component uses.
+116 */
+117 minplayer.display.prototype.getElements = function ( ) {
+118 return { } ;
+119 } ;
+120
+121 /**
+122 * Returns if this component is valid and exists within the DOM.
+123 *
+124 * @return {boolean} TRUE if the plugin display is valid.
+125 */
+126 minplayer.display.prototype.isValid = function ( ) {
+127 return ( this.display.length > 0 ) ;
+128 } ;
+129
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.file.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.file.js.html
new file mode 100644
index 0000000..f61e876
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.file.js.html
@@ -0,0 +1,173 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /**
+ 5 * @constructor
+ 6 * @class A wrapper class used to provide all the data necessary to control an
+ 7 * individual file within this media player.
+ 8 *
+ 9 * @param {object} file A media file object with minimal required information.
+ 10 */
+ 11 minplayer.file = function ( file ) {
+ 12 this.duration = file.duration || 0 ;
+ 13 this.bytesTotal = file.bytesTotal || 0 ;
+ 14 this.quality = file.quality || 0 ;
+ 15 this.stream = file.stream || '' ;
+ 16 this.path = file.path || '' ;
+ 17 this.codecs = file.codecs || '' ;
+ 18
+ 19 // These should be provided, but just in case...
+ 20 this.extension = file.extension || this.getFileExtension ( ) ;
+ 21 this.mimetype = file.mimetype || file.filemime || this.getMimeType ( ) ;
+ 22 this.type = file.type || this.getType ( ) ;
+ 23
+ 24 // Fail safe to try and guess the mimetype and media type.
+ 25 if ( ! this.type ) {
+ 26 this.mimetype = this.getMimeType ( ) ;
+ 27 this.type = this.getType ( ) ;
+ 28 }
+ 29
+ 30 // Get the player.
+ 31 this.player = file.player || this.getBestPlayer ( ) ;
+ 32 this.priority = file.priority || this.getPriority ( ) ;
+ 33 this.id = file.id || this.getId ( ) ;
+ 34 } ;
+ 35
+ 36 /**
+ 37 * Returns the best player for the job.
+ 38 *
+ 39 * @return {string} The best player to play the media file.
+ 40 */
+ 41 minplayer.file.prototype.getBestPlayer = function ( ) {
+ 42 var bestplayer = null , bestpriority = 0 , _this = this ;
+ 43 jQuery.each ( minplayer.players , function ( name , player ) {
+ 44 var priority = player.getPriority ( ) ;
+ 45 if ( player.canPlay ( _this ) && ( priority > bestpriority ) ) {
+ 46 bestplayer = name ;
+ 47 bestpriority = priority ;
+ 48 }
+ 49 } ) ;
+ 50 return bestplayer ;
+ 51 } ;
+ 52
+ 53 /**
+ 54 * The priority of this file is determined by the priority of the best
+ 55 * player multiplied by the priority of the mimetype.
+ 56 *
+ 57 * @return {integer} The priority of the media file.
+ 58 */
+ 59 minplayer.file.prototype.getPriority = function ( ) {
+ 60 var priority = 1 ;
+ 61 if ( this.player ) {
+ 62 priority = minplayer.players [ this.player ] . getPriority ( ) ;
+ 63 }
+ 64 switch ( this.mimetype ) {
+ 65 case 'video/x-webm' :
+ 66 case 'video/webm' :
+ 67 case 'application/octet-stream' :
+ 68 return priority * 10 ;
+ 69 case 'video/mp4' :
+ 70 case 'audio/mp4' :
+ 71 case 'audio/mpeg' :
+ 72 return priority * 9 ;
+ 73 case 'video/ogg' :
+ 74 case 'audio/ogg' :
+ 75 case 'video/quicktime' :
+ 76 return priority * 8 ;
+ 77 default :
+ 78 return priority * 5 ;
+ 79 }
+ 80 } ;
+ 81
+ 82 /**
+ 83 * Returns the file extension of the file path.
+ 84 *
+ 85 * @return {string} The file extension.
+ 86 */
+ 87 minplayer.file.prototype.getFileExtension = function ( ) {
+ 88 return this.path.substring ( this.path.lastIndexOf ( '.' ) + 1 ) . toLowerCase ( ) ;
+ 89 } ;
+ 90
+ 91 /**
+ 92 * Returns the proper mimetype based off of the extension.
+ 93 *
+ 94 * @return {string} The mimetype of the file based off of extension.
+ 95 */
+ 96 minplayer.file.prototype.getMimeType = function ( ) {
+ 97 switch ( this.extension ) {
+ 98 case 'mp4' : case 'm4v' : case 'flv' : case 'f4v' :
+ 99 return 'video/mp4' ;
+100 case 'webm' :
+101 return 'video/webm' ;
+102 case 'ogg' : case 'ogv' :
+103 return 'video/ogg' ;
+104 case '3g2' :
+105 return 'video/3gpp2' ;
+106 case '3gpp' :
+107 case '3gp' :
+108 return 'video/3gpp' ;
+109 case 'mov' :
+110 return 'video/quicktime' ;
+111 case 'swf' :
+112 return 'application/x-shockwave-flash' ;
+113 case 'oga' :
+114 return 'audio/ogg' ;
+115 case 'mp3' :
+116 return 'audio/mpeg' ;
+117 case 'm4a' : case 'f4a' :
+118 return 'audio/mp4' ;
+119 case 'aac' :
+120 return 'audio/aac' ;
+121 case 'wav' :
+122 return 'audio/vnd.wave' ;
+123 case 'wma' :
+124 return 'audio/x-ms-wma' ;
+125 default :
+126 return 'unknown' ;
+127 }
+128 } ;
+129
+130 /**
+131 * The type of media this is: video or audio.
+132 *
+133 * @return {string} "video" or "audio" based on what the type of media this
+134 * is.
+135 */
+136 minplayer.file.prototype.getType = function ( ) {
+137 switch ( this.mimetype ) {
+138 case 'video/mp4' :
+139 case 'video/webm' :
+140 case 'application/octet-stream' :
+141 case 'video/x-webm' :
+142 case 'video/ogg' :
+143 case 'video/3gpp2' :
+144 case 'video/3gpp' :
+145 case 'video/quicktime' :
+146 return 'video' ;
+147 case 'audio/mp3' :
+148 case 'audio/mp4' :
+149 case 'audio/ogg' :
+150 case 'audio/mpeg' :
+151 return 'audio' ;
+152 default :
+153 return '' ;
+154 }
+155 } ;
+156
+157 /**
+158 * Returns the ID for this media file.
+159 *
+160 * @return {string} The id for this media file which is provided by the player.
+161 */
+162 minplayer.file.prototype.getId = function ( ) {
+163 var player = minplayer.players [ this.player ] ;
+164 return ( player && player.getMediaId ) ? player.getMediaId ( this ) : '' ;
+165 } ;
+166
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.flags.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.flags.js.html
new file mode 100644
index 0000000..22c13e3
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.flags.js.html
@@ -0,0 +1,79 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /**
+ 5 * @constructor
+ 6 * @class This is a class used to keep track of flag states
+ 7 * which is used to control the busy cursor, big play button, among other
+ 8 * items in which multiple components can have an interest in hiding or
+ 9 * showing a single element on the screen.
+ 10 *
+ 11 * <p>
+ 12 * <strong>Usage:</strong>
+ 13 * <pre><code>
+ 14 * // Declare a flags variable.
+ 15 * var flags = new minplayer.flags();
+ 16 *
+ 17 * // Set the flag based on two components interested in the flag.
+ 18 * flags.setFlag("component1", true);
+ 19 * flags.setFlag("component2", true);
+ 20 *
+ 21 * // Print out the value of the flags. ( Prints 3 )
+ 22 * console.log(flags.flags);
+ 23 *
+ 24 * // Now unset a single components flag.
+ 25 * flags.setFlag("component1", false);
+ 26 *
+ 27 * // Print out the value of the flags.
+ 28 * console.log(flags.flags);
+ 29 *
+ 30 * // Unset the other components flag.
+ 31 * flags.setFlag("component2", false);
+ 32 *
+ 33 * // Print out the value of the flags.
+ 34 * console.log(flags.flags);
+ 35 * </code></pre>
+ 36 * </p>
+ 37 */
+ 38 minplayer.flags = function ( ) {
+ 39
+ 40 /** The flag. */
+ 41 this.flag = 0 ;
+ 42
+ 43 /** Id map to reference id with the flag index. */
+ 44 this.ids = { } ;
+ 45
+ 46 /** The number of flags. */
+ 47 this.numFlags = 0 ;
+ 48 } ;
+ 49
+ 50 /**
+ 51 * Sets a flag based on boolean logic operators.
+ 52 *
+ 53 * @param {string} id The id of the controller interested in this flag.
+ 54 * @param {boolean} value The value of this flag ( true or false ).
+ 55 */
+ 56 minplayer.flags.prototype.setFlag = function ( id , value ) {
+ 57
+ 58 // Define this id if it isn't present.
+ 59 if ( ! this.ids.hasOwnProperty ( id ) ) {
+ 60 this.ids [ id ] = this.numFlags ;
+ 61 this.numFlags ++ ;
+ 62 }
+ 63
+ 64 // Use binary operations to keep track of the flag state
+ 65 if ( value ) {
+ 66 this.flag | = ( 1 << this.ids [ id ] ) ;
+ 67 }
+ 68 else {
+ 69 this.flag & = ~ ( 1 << this.ids [ id ] ) ;
+ 70 }
+ 71 } ;
+ 72
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.image.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.image.js.html
new file mode 100644
index 0000000..d11b21b
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.image.js.html
@@ -0,0 +1,151 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /**
+ 5 * @constructor
+ 6 * @class A class to easily handle images.
+ 7 * @param {object} context The jQuery context.
+ 8 * @param {object} options This components options.
+ 9 */
+ 10 minplayer.image = function ( context , options ) {
+ 11
+ 12 // Determine if the image is loaded.
+ 13 this.loaded = false ;
+ 14
+ 15 // The image loader.
+ 16 this.loader = null ;
+ 17
+ 18 // The ratio of the image.
+ 19 this.ratio = 0 ;
+ 20
+ 21 // The image element.
+ 22 this.img = null ;
+ 23
+ 24 // Derive from display
+ 25 minplayer.display.call ( this , 'image' , context , options ) ;
+ 26 } ;
+ 27
+ 28 /** Derive from minplayer.display. */
+ 29 minplayer.image.prototype = new minplayer.display ( ) ;
+ 30
+ 31 /** Reset the constructor. */
+ 32 minplayer.image.prototype.constructor = minplayer.image ;
+ 33
+ 34 /**
+ 35 * @see minplayer.plugin.construct
+ 36 */
+ 37 minplayer.image.prototype.construct = function ( ) {
+ 38
+ 39 // Say we need to resize.
+ 40 this.allowResize = true ;
+ 41
+ 42 // Call the media display constructor.
+ 43 minplayer.display.prototype.construct.call ( this ) ;
+ 44
+ 45 // Set the container to not show any overflow...
+ 46 this.display.css ( 'overflow' , 'hidden' ) ;
+ 47
+ 48 // Create the image loader.
+ 49 var _this = this ;
+ 50
+ 51 /** The loader for the image. */
+ 52 this.loader = new Image ( ) ;
+ 53
+ 54 /** Register for when the image is loaded within the loader. */
+ 55 this.loader.onload = function ( ) {
+ 56 _this.loaded = true ;
+ 57 _this.ratio = ( _this.loader.width / _this.loader.height ) ;
+ 58 _this.resize ( ) ;
+ 59 _this.trigger ( 'loaded' ) ;
+ 60 } ;
+ 61
+ 62 // We are now ready.
+ 63 this.ready ( ) ;
+ 64 } ;
+ 65
+ 66 /**
+ 67 * Loads an image.
+ 68 *
+ 69 * @param {string} src The source of the image to load.
+ 70 */
+ 71 minplayer.image.prototype.load = function ( src ) {
+ 72
+ 73 // First clear the previous image.
+ 74 this.clear ( function ( ) {
+ 75
+ 76 // Create the new image, and append to the display.
+ 77 this.img = jQuery ( document.createElement ( 'img' ) ) . attr ( { src : '' } ) . hide ( ) ;
+ 78 this.display.append ( this.img ) ;
+ 79 this.loader.src = src ;
+ 80 } ) ;
+ 81 } ;
+ 82
+ 83 /**
+ 84 * Clears an image.
+ 85 *
+ 86 * @param {function} callback Called when the image is done clearing.
+ 87 */
+ 88 minplayer.image.prototype.clear = function ( callback ) {
+ 89 this.loaded = false ;
+ 90 if ( this.img ) {
+ 91 var _this = this ;
+ 92 this.img.fadeOut ( function ( ) {
+ 93 _this.img.attr ( 'src' , '' ) ;
+ 94 _this.loader.src = '' ;
+ 95 $ ( this ) . remove ( ) ;
+ 96 callback.call ( _this ) ;
+ 97 } ) ;
+ 98 }
+ 99 else {
+100 callback.call ( this ) ;
+101 }
+102 } ;
+103
+104 /**
+105 * Resize the image provided a width and height or nothing.
+106 *
+107 * @param {integer} width (optional) The width of the container.
+108 * @param {integer} height (optional) The height of the container.
+109 */
+110 minplayer.image.prototype.resize = function ( width , height ) {
+111 width = width || this.display.width ( ) ;
+112 height = height || this.display.height ( ) ;
+113 if ( width && height && this.loaded ) {
+114
+115 // Get the scaled rectangle.
+116 var rect = this.getScaledRect ( this.ratio , {
+117 width : width ,
+118 height : height
+119 } ) ;
+120
+121 // Now set this image to the new size.
+122 if ( this.img ) {
+123 this.img.attr ( 'src' , this.loader.src ) . css ( {
+124 marginLeft : rect.x ,
+125 marginTop : rect.y ,
+126 width : rect.width ,
+127 height : rect.height
+128 } ) ;
+129 }
+130
+131 // Show the container.
+132 this.img.fadeIn ( ) ;
+133 }
+134 } ;
+135
+136 /**
+137 * @see minplayer.display#onResize
+138 */
+139 minplayer.image.prototype.onResize = function ( ) {
+140
+141 // Resize the image to fit.
+142 this.resize ( ) ;
+143 } ;
+144
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.js.html
new file mode 100644
index 0000000..e98ff76
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.js.html
@@ -0,0 +1,354 @@
+ 1 // Add a way to instanciate using jQuery prototype.
+ 2 if ( ! jQuery.fn.minplayer ) {
+ 3
+ 4 /**
+ 5 * @constructor
+ 6 *
+ 7 * Define a jQuery minplayer prototype.
+ 8 *
+ 9 * @param {object} options The options for this jQuery prototype.
+ 10 * @return {Array} jQuery object.
+ 11 */
+ 12 jQuery.fn.minplayer = function ( options ) {
+ 13 return jQuery ( this ) . each ( function ( ) {
+ 14 options = options || { } ;
+ 15 options.id = options.id || $ ( this ) . attr ( 'id' ) || Math.random ( ) ;
+ 16 if ( ! minplayer.plugins [ options.id ] ) {
+ 17 var template = options.template || 'default' ;
+ 18 if ( minplayer [ template ] ) {
+ 19 new minplayer [ template ] ( jQuery ( this ) , options ) ;
+ 20 }
+ 21 else {
+ 22 new minplayer ( jQuery ( this ) , options ) ;
+ 23 }
+ 24 }
+ 25 } ) ;
+ 26 } ;
+ 27 }
+ 28
+ 29 /**
+ 30 * @constructor
+ 31 * @extends minplayer.display
+ 32 * @class The core media player class which governs the media player
+ 33 * functionality.
+ 34 *
+ 35 * <p><strong>Usage:</strong>
+ 36 * <pre><code>
+ 37 *
+ 38 * // Create a media player.
+ 39 * var player = jQuery("#player").minplayer({
+ 40 *
+ 41 * });
+ 42 *
+ 43 * </code></pre>
+ 44 * </p>
+ 45 *
+ 46 * @param {object} context The jQuery context.
+ 47 * @param {object} options This components options.
+ 48 */
+ 49 minplayer = jQuery.extend ( function ( context , options ) {
+ 50
+ 51 // Make sure we provide default options...
+ 52 options = jQuery.extend ( {
+ 53 id : 'player' ,
+ 54 swfplayer : '' ,
+ 55 wmode : 'transparent' ,
+ 56 preload : true ,
+ 57 autoplay : false ,
+ 58 loop : false ,
+ 59 width : '100%' ,
+ 60 height : '350px' ,
+ 61 debug : false ,
+ 62 volume : 80 ,
+ 63 files : [ ] ,
+ 64 file : '' ,
+ 65 preview : '' ,
+ 66 attributes : { }
+ 67 } , options ) ;
+ 68
+ 69 // Setup the plugins.
+ 70 options.plugins = jQuery.extend ( {
+ 71 controller : 'default' ,
+ 72 playLoader : 'default'
+ 73 } , options.plugins ) ;
+ 74
+ 75 // Derive from display
+ 76 minplayer.display.call ( this , 'player' , context , options ) ;
+ 77 } , minplayer ) ;
+ 78
+ 79 /** Derive from minplayer.display. */
+ 80 minplayer.prototype = new minplayer.display ( ) ;
+ 81
+ 82 /** Reset the constructor. */
+ 83 minplayer.prototype.constructor = minplayer ;
+ 84
+ 85 /**
+ 86 * Define a way to debug.
+ 87 */
+ 88 minplayer.console = console || { log : function ( data ) { } } ;
+ 89
+ 90 /**
+ 91 * @see minplayer.plugin.construct
+ 92 */
+ 93 minplayer.prototype.construct = function ( ) {
+ 94
+ 95 // Call the minplayer display constructor.
+ 96 minplayer.display.prototype.construct.call ( this ) ;
+ 97
+ 98 // Load the plugins.
+ 99 this.loadPlugins ( ) ;
+100
+101 /** Variable to store the current media player. */
+102 this.currentPlayer = 'html5' ;
+103
+104 // Add key events to the window.
+105 this.addKeyEvents ( ) ;
+106
+107 // Now load these files.
+108 this.load ( this.getFiles ( ) ) ;
+109
+110 // Add the player events.
+111 this.addEvents ( ) ;
+112
+113 // The player is ready.
+114 this.ready ( ) ;
+115 } ;
+116
+117 /**
+118 * We need to bind to events we are interested in.
+119 */
+120 minplayer.prototype.addEvents = function ( ) {
+121 var _this = this ;
+122 minplayer.get.call ( this , this.options.id , null , function ( plugin ) {
+123
+124 // Bind to the error event.
+125 plugin.bind ( 'error' , function ( event , data ) {
+126
+127 // If an error occurs within the html5 media player, then try
+128 // to fall back to the flash player.
+129 if ( _this.currentPlayer == 'html5' ) {
+130 _this.options.file.player = 'minplayer' ;
+131 _this.loadPlayer ( ) ;
+132 }
+133 else {
+134 _this.error ( data ) ;
+135 }
+136 } ) ;
+137
+138 // Bind to the fullscreen event.
+139 plugin.bind ( 'fullscreen' , function ( event , data ) {
+140 _this.resize ( ) ;
+141 } ) ;
+142 } ) ;
+143 } ;
+144
+145 /**
+146 * Sets an error on the player.
+147 *
+148 * @param {string} error The error to display on the player.
+149 */
+150 minplayer.prototype.error = function ( error ) {
+151 error = error || '' ;
+152 if ( this.elements.error ) {
+153
+154 // Set the error text.
+155 this.elements.error.text ( error ) ;
+156 if ( error ) {
+157 this.elements.error.show ( ) ;
+158 }
+159 else {
+160 this.elements.error.hide ( ) ;
+161 }
+162 }
+163 } ;
+164
+165 /**
+166 * Adds key events to the player.
+167 */
+168 minplayer.prototype.addKeyEvents = function ( ) {
+169
+170 // Bind to key events...
+171 jQuery ( document ) . bind ( 'keydown' , { obj : this } , function ( e ) {
+172 switch ( e.keyCode ) {
+173 case 113 : // ESC
+174 case 27 : // Q
+175 e.data.obj.display.removeClass ( 'fullscreen' ) ;
+176 break ;
+177 }
+178 } ) ;
+179 } ;
+180
+181 /**
+182 * Returns all the media files available for this player.
+183 *
+184 * @return {array} All the media files for this player.
+185 */
+186 minplayer.prototype.getFiles = function ( ) {
+187 var files = [ ] ;
+188 var mediaSrc = null ;
+189
+190 // Get the files involved...
+191 if ( this.elements.media ) {
+192 mediaSrc = this.elements.media.attr ( 'src' ) ;
+193 if ( mediaSrc ) {
+194 files.push ( { 'path' : mediaSrc } ) ;
+195 }
+196 jQuery ( 'source' , this.elements.media ) . each ( function ( ) {
+197 files.push ( {
+198 'path' : jQuery ( this ) . attr ( 'src' ) ,
+199 'mimetype' : jQuery ( this ) . attr ( 'type' ) ,
+200 'codecs' : jQuery ( this ) . attr ( 'codecs' )
+201 } ) ;
+202 } ) ;
+203 }
+204
+205 return files ;
+206 } ;
+207
+208 /**
+209 * Returns the full media player object.
+210 * @param {array} files An array of files to chose from.
+211 * @return {object} The best media file to play in the current browser.
+212 */
+213 minplayer.prototype.getMediaFile = function ( files ) {
+214
+215 // If there are no files then return null.
+216 if ( ! files ) {
+217 return null ;
+218 }
+219
+220 // If the file is a single string, then return the file object.
+221 if ( typeof files === 'string' ) {
+222 return new minplayer.file ( { 'path' : files } ) ;
+223 }
+224
+225 // If the file is already a file object then just return.
+226 if ( files.path ) {
+227 return new minplayer.file ( files ) ;
+228 }
+229
+230 // Add the files and get the best player to play.
+231 var i = files.length , bestPriority = 0 , mFile = null , file = null ;
+232 while ( i -- ) {
+233 file = files [ i ] ;
+234
+235 // Get the minplayer file object.
+236 if ( typeof file === 'string' ) {
+237 file = new minplayer.file ( { 'path' : file } ) ;
+238 }
+239 else {
+240 file = new minplayer.file ( file ) ;
+241 }
+242
+243 // Determine the best file for this browser.
+244 if ( file.priority > bestPriority ) {
+245 mFile = file ;
+246 }
+247 }
+248
+249 // Return the best minplayer file.
+250 return mFile ;
+251 } ;
+252
+253 /**
+254 * Loads a media player based on the current file.
+255 */
+256 minplayer.prototype.loadPlayer = function ( ) {
+257
+258 // Do nothing if there isn't a file.
+259 if ( ! this.options.file ) {
+260 this.error ( 'No media found.' ) ;
+261 return ;
+262 }
+263
+264 if ( ! this.options.file.player ) {
+265 this.error ( 'Cannot play media: ' + this.options.file.mimetype ) ;
+266 return ;
+267 }
+268
+269 // Reset the error.
+270 this.error ( ) ;
+271
+272 // Only destroy if the current player is different than the new player.
+273 var player = this.options.file.player.toString ( ) ;
+274
+275 // If there isn't media or if the players are different.
+276 if ( ! this.media || ( player !== this.currentPlayer ) ) {
+277
+278 // Set the current media player.
+279 this.currentPlayer = player ;
+280
+281 // Do nothing if we don't have a display.
+282 if ( ! this.elements.display ) {
+283 this.error ( 'No media display found.' ) ;
+284 return ;
+285 }
+286
+287 // Store the queue.
+288 var queue = this.media ? this.media.queue : { } ;
+289
+290 // Destroy the current media.
+291 if ( this.media ) {
+292 this.media.destroy ( ) ;
+293 }
+294
+295 // Get the class name and create the new player.
+296 pClass = minplayer.players [ this.options.file.player ] ;
+297
+298 // Create the new media player.
+299 this.media = new pClass ( this.elements.display , this.options ) ;
+300
+301 // Restore the queue.
+302 this.media.queue = queue ;
+303
+304 // Now get the media when it is ready.
+305 this.get ( 'media' , function ( media ) {
+306
+307 // Load the media.
+308 media.load ( ) ;
+309 } ) ;
+310 }
+311 // If the media object already exists...
+312 else if ( this.media ) {
+313
+314 // Now load the different media file.
+315 this.media.load ( this.options.file ) ;
+316 }
+317 } ;
+318
+319 /**
+320 * Load a set of files or a single file for the media player.
+321 *
+322 * @param {array} files An array of files to chose from to load.
+323 */
+324 minplayer.prototype.load = function ( files ) {
+325
+326 // Set the id and class.
+327 var id = '' , pClass = '' ;
+328
+329 // If no file was provided, then get it.
+330 this.options.files = files || this.options.files ;
+331 this.options.file = this.getMediaFile ( this.options.files ) ;
+332
+333 // Now load the player.
+334 this.loadPlayer ( ) ;
+335 } ;
+336
+337 /**
+338 * Called when the player is resized.
+339 */
+340 minplayer.prototype.resize = function ( ) {
+341
+342 // Call onRezie for each plugin.
+343 this.get ( function ( plugin ) {
+344 plugin.onResize ( ) ;
+345 } ) ;
+346 } ;
+347
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.playLoader.base.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.playLoader.base.js.html
new file mode 100644
index 0000000..f65cb3d
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.playLoader.base.js.html
@@ -0,0 +1,190 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /** Define the playLoader object. */
+ 5 minplayer.playLoader = minplayer.playLoader || { } ;
+ 6
+ 7 /**
+ 8 * @constructor
+ 9 * @extends minplayer.display
+ 10 * @class The play loader base class, which is used to control the busy
+ 11 * cursor, big play button, and the opaque background which shows when the
+ 12 * player is paused.
+ 13 *
+ 14 * @param {object} context The jQuery context.
+ 15 * @param {object} options This components options.
+ 16 */
+ 17 minplayer.playLoader.base = function ( context , options ) {
+ 18
+ 19 // Define the flags that control the busy cursor.
+ 20 this.busy = new minplayer.flags ( ) ;
+ 21
+ 22 // Define the flags that control the big play button.
+ 23 this.bigPlay = new minplayer.flags ( ) ;
+ 24
+ 25 /** The preview image. */
+ 26 this.preview = null ;
+ 27
+ 28 // Derive from display
+ 29 minplayer.display.call ( this , 'playLoader' , context , options ) ;
+ 30 } ;
+ 31
+ 32 /** Derive from minplayer.display. */
+ 33 minplayer.playLoader.base.prototype = new minplayer.display ( ) ;
+ 34
+ 35 /** Reset the constructor. */
+ 36 minplayer.playLoader.base.prototype.constructor = minplayer.playLoader.base ;
+ 37
+ 38 /**
+ 39 * The constructor.
+ 40 */
+ 41 minplayer.playLoader.base.prototype.construct = function ( ) {
+ 42
+ 43 // Call the media display constructor.
+ 44 minplayer.display.prototype.construct.call ( this ) ;
+ 45
+ 46 // Get the media plugin.
+ 47 this.get ( 'media' , function ( media ) {
+ 48
+ 49 // Only bind if this player does not have its own play loader.
+ 50 if ( ! media.hasPlayLoader ( ) ) {
+ 51
+ 52 // Load the preview image.
+ 53 this.loadPreview ( ) ;
+ 54
+ 55 // Trigger a play event when someone clicks on the controller.
+ 56 if ( this.elements.bigPlay ) {
+ 57 this.elements.bigPlay.unbind ( ) . bind ( 'click' , function ( event ) {
+ 58 event.preventDefault ( ) ;
+ 59 jQuery ( this ) . hide ( ) ;
+ 60 media.play ( ) ;
+ 61 } ) ;
+ 62 }
+ 63
+ 64 // Bind to the player events to control the play loader.
+ 65 media.unbind ( 'loadstart' ) . bind ( 'loadstart' , { obj : this } , function ( event ) {
+ 66 event.data.obj.busy.setFlag ( 'media' , true ) ;
+ 67 event.data.obj.bigPlay.setFlag ( 'media' , true ) ;
+ 68 if ( event.data.obj.preview ) {
+ 69 event.data.obj.elements.preview.show ( ) ;
+ 70 }
+ 71 event.data.obj.checkVisibility ( ) ;
+ 72 } ) ;
+ 73 media.bind ( 'waiting' , { obj : this } , function ( event ) {
+ 74 event.data.obj.busy.setFlag ( 'media' , true ) ;
+ 75 event.data.obj.checkVisibility ( ) ;
+ 76 } ) ;
+ 77 media.bind ( 'loadeddata' , { obj : this } , function ( event ) {
+ 78 event.data.obj.busy.setFlag ( 'media' , false ) ;
+ 79 event.data.obj.checkVisibility ( ) ;
+ 80 } ) ;
+ 81 media.bind ( 'playing' , { obj : this } , function ( event ) {
+ 82 event.data.obj.busy.setFlag ( 'media' , false ) ;
+ 83 event.data.obj.bigPlay.setFlag ( 'media' , false ) ;
+ 84 if ( event.data.obj.preview ) {
+ 85 event.data.obj.elements.preview.hide ( ) ;
+ 86 }
+ 87 event.data.obj.checkVisibility ( ) ;
+ 88 } ) ;
+ 89 media.bind ( 'pause' , { obj : this } , function ( event ) {
+ 90 event.data.obj.bigPlay.setFlag ( 'media' , true ) ;
+ 91 event.data.obj.checkVisibility ( ) ;
+ 92 } ) ;
+ 93 }
+ 94 else {
+ 95
+ 96 // Hide the busy cursor.
+ 97 if ( this.elements.busy ) {
+ 98 this.elements.busy.unbind ( ) . hide ( ) ;
+ 99 }
+100
+101 // Hide the big play button.
+102 if ( this.elements.bigPlay ) {
+103 this.elements.bigPlay.unbind ( ) . hide ( ) ;
+104 }
+105
+106 // Hide the display.
+107 this.display.unbind ( ) . hide ( ) ;
+108 }
+109 } ) ;
+110
+111 // We are now ready.
+112 this.ready ( ) ;
+113 } ;
+114
+115 /**
+116 * Loads the preview image.
+117 */
+118 minplayer.playLoader.base.prototype.loadPreview = function ( ) {
+119
+120 // If the preview element exists.
+121 if ( this.elements.preview ) {
+122
+123 // Get the poster image.
+124 if ( ! this.options.preview ) {
+125 this.options.preview = this.elements.media.attr ( 'poster' ) ;
+126 }
+127
+128 // Reset the media's poster image.
+129 this.elements.media.attr ( 'poster' , '' ) ;
+130
+131 // If there is a preview to show...
+132 if ( this.options.preview ) {
+133
+134 // Say that this has a preview.
+135 this.elements.preview.addClass ( 'has-preview' ) . show ( ) ;
+136
+137 // Create a new preview image.
+138 this.preview = new minplayer.image ( this.elements.preview , this.options ) ;
+139
+140 // Create the image.
+141 this.preview.load ( this.options.preview ) ;
+142 }
+143 else {
+144
+145 // Hide the preview.
+146 this.elements.preview.hide ( ) ;
+147 }
+148 }
+149 } ;
+150
+151 /**
+152 * Hide or show certain elements based on the state of the busy and big play
+153 * button.
+154 */
+155 minplayer.playLoader.base.prototype.checkVisibility = function ( ) {
+156
+157 // Hide or show the busy cursor based on the flags.
+158 if ( this.busy.flag ) {
+159 this.elements.busy.show ( ) ;
+160 }
+161 else {
+162 this.elements.busy.hide ( ) ;
+163 }
+164
+165 // Hide or show the big play button based on the flags.
+166 if ( this.bigPlay.flag ) {
+167 this.elements.bigPlay.show ( ) ;
+168 }
+169 else {
+170 this.elements.bigPlay.hide ( ) ;
+171 }
+172
+173 // Show the control either flag is set.
+174 if ( this.bigPlay.flag || this.busy.flag ) {
+175 this.display.show ( ) ;
+176 }
+177
+178 // Hide the whole control if both flags are 0.
+179 if ( ! this.bigPlay.flag && ! this.busy.flag ) {
+180 this.display.hide ( ) ;
+181 }
+182 } ;
+183
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.players.base.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.players.base.js.html
new file mode 100644
index 0000000..dc6b27a
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.players.base.js.html
@@ -0,0 +1,572 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /** All the media player implementations */
+ 5 minplayer.players = minplayer.players || { } ;
+ 6
+ 7 /**
+ 8 * @constructor
+ 9 * @extends minplayer.display
+ 10 * @class The base media player class where all media players derive from.
+ 11 *
+ 12 * @param {object} context The jQuery context.
+ 13 * @param {object} options This components options.
+ 14 */
+ 15 minplayer.players.base = function ( context , options ) {
+ 16
+ 17 // Derive from display
+ 18 minplayer.display.call ( this , 'media' , context , options ) ;
+ 19 } ;
+ 20
+ 21 /** Derive from minplayer.display. */
+ 22 minplayer.players.base.prototype = new minplayer.display ( ) ;
+ 23
+ 24 /** Reset the constructor. */
+ 25 minplayer.players.base.prototype.constructor = minplayer.players.base ;
+ 26
+ 27 /**
+ 28 * Get the priority of this media player.
+ 29 *
+ 30 * @return {number} The priority of this media player.
+ 31 */
+ 32 minplayer.players.base.getPriority = function ( ) {
+ 33 return 0 ;
+ 34 } ;
+ 35
+ 36 /**
+ 37 * Returns the ID for the media being played.
+ 38 *
+ 39 * @param {object} file A {@link minplayer.file} object.
+ 40 * @return {string} The ID for the provided media.
+ 41 */
+ 42 minplayer.players.base.getMediaId = function ( file ) {
+ 43 return '' ;
+ 44 } ;
+ 45
+ 46 /**
+ 47 * Determine if we can play the media file.
+ 48 *
+ 49 * @param {object} file A {@link minplayer.file} object.
+ 50 * @return {boolean} If this player can play this media type.
+ 51 */
+ 52 minplayer.players.base.canPlay = function ( file ) {
+ 53 return false ;
+ 54 } ;
+ 55
+ 56 /**
+ 57 * @see minplayer.plugin.construct
+ 58 * @this minplayer.players.base
+ 59 */
+ 60 minplayer.players.base.prototype.construct = function ( ) {
+ 61
+ 62 // Call the media display constructor.
+ 63 minplayer.display.prototype.construct.call ( this ) ;
+ 64
+ 65 // Reset the variables to initial state.
+ 66 this.reset ( ) ;
+ 67
+ 68 /** The currently loaded media file. */
+ 69 this.mediaFile = this.options.file ;
+ 70
+ 71 // Get the player display object.
+ 72 if ( ! this.playerFound ( ) ) {
+ 73
+ 74 // Remove the media element if found
+ 75 if ( this.elements.media ) {
+ 76 this.elements.media.remove ( ) ;
+ 77 }
+ 78
+ 79 // Create a new media player element.
+ 80 this.display.html ( this.create ( ) ) ;
+ 81 }
+ 82
+ 83 // Get the player object...
+ 84 this.player = this.getPlayer ( ) ;
+ 85
+ 86 // Set the focus of the element based on if they click in or outside of it.
+ 87 var _this = this ;
+ 88 jQuery ( document ) . bind ( 'click' , function ( e ) {
+ 89 if ( jQuery ( e.target ) . closest ( '#' + _this.options.id ) . length == 0 ) {
+ 90 _this.hasFocus = false ;
+ 91 }
+ 92 else {
+ 93 _this.hasFocus = true ;
+ 94 }
+ 95 } ) ;
+ 96
+ 97 // Bind to key events...
+ 98 jQuery ( document ) . bind ( 'keydown' , { obj : this } , function ( e ) {
+ 99 if ( e.data.obj.hasFocus ) {
+100 e.preventDefault ( ) ;
+101 switch ( e.keyCode ) {
+102 case 32 : // SPACE
+103 case 179 : // GOOGLE play/pause button.
+104 if ( e.data.obj.playing ) {
+105 e.data.obj.pause ( ) ;
+106 }
+107 else {
+108 e.data.obj.play ( ) ;
+109 }
+110 break ;
+111 case 38 : // UP
+112 e.data.obj.setVolumeRelative ( 0.1 ) ;
+113 break ;
+114 case 40 : // DOWN
+115 e.data.obj.setVolumeRelative ( - 0.1 ) ;
+116 break ;
+117 case 37 : // LEFT
+118 case 227 : // GOOGLE TV REW
+119 e.data.obj.seekRelative ( - 0.05 ) ;
+120 break ;
+121 case 39 : // RIGHT
+122 case 228 : // GOOGLE TV FW
+123 e.data.obj.seekRelative ( 0.05 ) ;
+124 break ;
+125 }
+126 }
+127 } ) ;
+128 } ;
+129
+130 /**
+131 * @see minplayer.plugin.destroy.
+132 */
+133 minplayer.players.base.prototype.destroy = function ( ) {
+134 minplayer.plugin.prototype.destroy.call ( this ) ;
+135
+136 // Reset the player.
+137 this.reset ( ) ;
+138 } ;
+139
+140 /**
+141 * Resets all variables.
+142 */
+143 minplayer.players.base.prototype.reset = function ( ) {
+144
+145 // Reset the ready flag.
+146 this.playerReady = false ;
+147
+148 // The duration of the player.
+149 this.duration = new minplayer.async ( ) ;
+150
+151 // The current play time of the player.
+152 this.currentTime = new minplayer.async ( ) ;
+153
+154 // The amount of bytes loaded in the player.
+155 this.bytesLoaded = new minplayer.async ( ) ;
+156
+157 // The total amount of bytes for the media.
+158 this.bytesTotal = new minplayer.async ( ) ;
+159
+160 // The bytes that the download started with.
+161 this.bytesStart = new minplayer.async ( ) ;
+162
+163 // The current volume of the player.
+164 this.volume = new minplayer.async ( ) ;
+165
+166 // Reset focus.
+167 this.hasFocus = false ;
+168
+169 // We are not playing.
+170 this.playing = false ;
+171
+172 // We are not loading.
+173 this.loading = false ;
+174
+175 // If the player exists, then unbind all events.
+176 if ( this.player ) {
+177 jQuery ( this.player ) . unbind ( ) ;
+178 }
+179 } ;
+180
+181 /**
+182 * Create a polling timer.
+183 * @param {function} callback The function to call when you poll.
+184 */
+185 minplayer.players.base.prototype.poll = function ( callback ) {
+186 var _this = this ;
+187 setTimeout ( function later ( ) {
+188 if ( callback.call ( _this ) ) {
+189 setTimeout ( later , 1000 ) ;
+190 }
+191 } , 1000 ) ;
+192 } ;
+193
+194 /**
+195 * Called when the player is ready to recieve events and commands.
+196 */
+197 minplayer.players.base.prototype.onReady = function ( ) {
+198 // Store the this pointer.
+199 var _this = this ;
+200
+201 // Set the ready flag.
+202 this.playerReady = true ;
+203
+204 // Set the volume to the default.
+205 this.setVolume ( this.options.volume / 100 ) ;
+206
+207 // Setup the progress interval.
+208 this.loading = true ;
+209
+210 // Create a poll to get the progress.
+211 this.poll ( function ( ) {
+212
+213 // Only do this if the play interval is set.
+214 if ( _this.loading ) {
+215
+216 // Get the bytes loaded asynchronously.
+217 _this.getBytesLoaded ( function ( bytesLoaded ) {
+218
+219 // Get the bytes total asynchronously.
+220 _this.getBytesTotal ( function ( bytesTotal ) {
+221
+222 // Trigger an event about the progress.
+223 if ( bytesLoaded || bytesTotal ) {
+224
+225 // Get the bytes start, but don't require it.
+226 var bytesStart = 0 ;
+227 _this.getBytesStart ( function ( val ) {
+228 bytesStart = val ;
+229 } ) ;
+230
+231 // Trigger a progress event.
+232 _this.trigger ( 'progress' , {
+233 loaded : bytesLoaded ,
+234 total : bytesTotal ,
+235 start : bytesStart
+236 } ) ;
+237
+238 // Say we are not longer loading if they are equal.
+239 if ( bytesLoaded >= bytesTotal ) {
+240 _this.loading = false ;
+241 }
+242 }
+243 } ) ;
+244 } ) ;
+245 }
+246
+247 return _this.loading ;
+248 } ) ;
+249
+250 // We are now ready.
+251 this.ready ( ) ;
+252
+253 // Trigger that the load has started.
+254 this.trigger ( 'loadstart' ) ;
+255 } ;
+256
+257 /**
+258 * Should be called when the media is playing.
+259 */
+260 minplayer.players.base.prototype.onPlaying = function ( ) {
+261 // Store the this pointer.
+262 var _this = this ;
+263
+264 // Trigger an event that we are playing.
+265 this.trigger ( 'playing' ) ;
+266
+267 // Say that this player has focus.
+268 this.hasFocus = true ;
+269
+270 // Set the playInterval to true.
+271 this.playing = true ;
+272
+273 // Create a poll to get the timeupate.
+274 this.poll ( function ( ) {
+275
+276 // Only do this if the play interval is set.
+277 if ( _this.playing ) {
+278
+279 // Get the current time asyncrhonously.
+280 _this.getCurrentTime ( function ( currentTime ) {
+281
+282 // Get the duration asynchronously.
+283 _this.getDuration ( function ( duration ) {
+284
+285 // Convert these to floats.
+286 currentTime = parseFloat ( currentTime ) ;
+287 duration = parseFloat ( duration ) ;
+288
+289 // Trigger an event about the progress.
+290 if ( currentTime || duration ) {
+291
+292 // Trigger an update event.
+293 _this.trigger ( 'timeupdate' , {
+294 currentTime : currentTime ,
+295 duration : duration
+296 } ) ;
+297 }
+298 } ) ;
+299 } ) ;
+300 }
+301
+302 return _this.playing ;
+303 } ) ;
+304 } ;
+305
+306 /**
+307 * Should be called when the media is paused.
+308 */
+309 minplayer.players.base.prototype.onPaused = function ( ) {
+310
+311 // Trigger an event that we are paused.
+312 this.trigger ( 'pause' ) ;
+313
+314 // Remove focus.
+315 this.hasFocus = false ;
+316
+317 // Say we are not playing.
+318 this.playing = false ;
+319 } ;
+320
+321 /**
+322 * Should be called when the media is complete.
+323 */
+324 minplayer.players.base.prototype.onComplete = function ( ) {
+325 // Stop the intervals.
+326 this.playing = false ;
+327 this.loading = false ;
+328 this.hasFocus = false ;
+329 this.trigger ( 'ended' ) ;
+330 } ;
+331
+332 /**
+333 * Should be called when the media is done loading.
+334 */
+335 minplayer.players.base.prototype.onLoaded = function ( ) {
+336 this.trigger ( 'loadeddata' ) ;
+337 } ;
+338
+339 /**
+340 * Should be called when the player is waiting.
+341 */
+342 minplayer.players.base.prototype.onWaiting = function ( ) {
+343 this.trigger ( 'waiting' ) ;
+344 } ;
+345
+346 /**
+347 * Called when an error occurs.
+348 *
+349 * @param {string} errorCode The error that was triggered.
+350 */
+351 minplayer.players.base.prototype.onError = function ( errorCode ) {
+352 this.hasFocus = false ;
+353 this.trigger ( 'error' , errorCode ) ;
+354 } ;
+355
+356 /**
+357 * @see minplayer.players.base#isReady
+358 * @return {boolean} Checks to see if the Flash is ready.
+359 */
+360 minplayer.players.base.prototype.isReady = function ( ) {
+361
+362 // Return that the player is set and the ready flag is good.
+363 return ( this.player && this.playerReady ) ;
+364 } ;
+365
+366 /**
+367 * Determines if the player should show the playloader.
+368 *
+369 * @return {bool} If this player implements its own playLoader.
+370 */
+371 minplayer.players.base.prototype.hasPlayLoader = function ( ) {
+372 return false ;
+373 } ;
+374
+375 /**
+376 * Returns if the media player is already within the DOM.
+377 *
+378 * @return {boolean} TRUE - if the player is in the DOM, FALSE otherwise.
+379 */
+380 minplayer.players.base.prototype.playerFound = function ( ) {
+381 return false ;
+382 } ;
+383
+384 /**
+385 * Creates the media player and inserts it in the DOM.
+386 *
+387 * @return {object} The media player entity.
+388 */
+389 minplayer.players.base.prototype.create = function ( ) {
+390 this.reset ( ) ;
+391 return null ;
+392 } ;
+393
+394 /**
+395 * Returns the media player object.
+396 *
+397 * @return {object} The media player object.
+398 */
+399 minplayer.players.base.prototype.getPlayer = function ( ) {
+400 return this.player ;
+401 } ;
+402
+403 /**
+404 * Loads a new media player.
+405 *
+406 * @param {object} file A {@link minplayer.file} object.
+407 */
+408 minplayer.players.base.prototype.load = function ( file ) {
+409
+410 // Store the media file for future lookup.
+411 if ( file ) {
+412 this.reset ( ) ;
+413 this.mediaFile = file ;
+414 }
+415 } ;
+416
+417 /**
+418 * Play the loaded media file.
+419 */
+420 minplayer.players.base.prototype.play = function ( ) {
+421 } ;
+422
+423 /**
+424 * Pause the loaded media file.
+425 */
+426 minplayer.players.base.prototype.pause = function ( ) {
+427 } ;
+428
+429 /**
+430 * Stop the loaded media file.
+431 */
+432 minplayer.players.base.prototype.stop = function ( ) {
+433 this.playing = false ;
+434 this.loading = false ;
+435 this.hasFocus = false ;
+436 } ;
+437
+438 /**
+439 * Seeks to relative position.
+440 *
+441 * @param {number} pos Relative position. -1 to 1 (percent), > 1 (seconds).
+442 */
+443 minplayer.players.base.prototype.seekRelative = function ( pos ) {
+444
+445 // Get the current time asyncrhonously.
+446 var _this = this ;
+447 this.getCurrentTime ( function ( currentTime ) {
+448
+449 // Get the duration asynchronously.
+450 _this.getDuration ( function ( duration ) {
+451
+452 // Only do this if we have a duration.
+453 if ( duration ) {
+454
+455 // Get the position.
+456 var seekPos = 0 ;
+457 if ( ( pos > - 1 ) && ( pos < 1 ) ) {
+458 seekPos = ( currentTime / duration ) + parseFloat ( pos ) ;
+459 }
+460 else {
+461 seekPos = ( currentTime + parseFloat ( pos ) ) / duration ;
+462 }
+463
+464 // Set the seek value.
+465 _this.seek ( seekPos ) ;
+466 }
+467 } ) ;
+468 } ) ;
+469 } ;
+470
+471 /**
+472 * Seek the loaded media.
+473 *
+474 * @param {number} pos The position to seek the minplayer. 0 to 1.
+475 */
+476 minplayer.players.base.prototype.seek = function ( pos ) {
+477 } ;
+478
+479 /**
+480 * Set the volume of the loaded minplayer.
+481 *
+482 * @param {number} vol -1 to 1 - The relative amount to increase or decrease.
+483 */
+484 minplayer.players.base.prototype.setVolumeRelative = function ( vol ) {
+485
+486 // Get the volume
+487 var _this = this ;
+488 this.getVolume ( function ( newVol ) {
+489 newVol + = parseFloat ( vol ) ;
+490 newVol = ( newVol < 0 ) ? 0 : newVol ;
+491 newVol = ( newVol > 1 ) ? 1 : newVol ;
+492 _this.setVolume ( newVol ) ;
+493 } ) ;
+494 } ;
+495
+496 /**
+497 * Set the volume of the loaded minplayer.
+498 *
+499 * @param {number} vol The volume to set the media. 0 to 1.
+500 */
+501 minplayer.players.base.prototype.setVolume = function ( vol ) {
+502 this.trigger ( 'volumeupdate' , vol ) ;
+503 } ;
+504
+505 /**
+506 * Get the volume from the loaded media.
+507 *
+508 * @param {function} callback Called when the volume is determined.
+509 * @return {number} The volume of the media; 0 to 1.
+510 */
+511 minplayer.players.base.prototype.getVolume = function ( callback ) {
+512 return this.volume.get ( callback ) ;
+513 } ;
+514
+515 /**
+516 * Get the current time for the media being played.
+517 *
+518 * @param {function} callback Called when the time is determined.
+519 * @return {number} The volume of the media; 0 to 1.
+520 */
+521 minplayer.players.base.prototype.getCurrentTime = function ( callback ) {
+522 return this.currentTime.get ( callback ) ;
+523 } ;
+524
+525 /**
+526 * Return the duration of the loaded media.
+527 *
+528 * @param {function} callback Called when the duration is determined.
+529 * @return {number} The duration of the loaded media.
+530 */
+531 minplayer.players.base.prototype.getDuration = function ( callback ) {
+532 return this.duration.get ( callback ) ;
+533 } ;
+534
+535 /**
+536 * Return the start bytes for the loaded media.
+537 *
+538 * @param {function} callback Called when the start bytes is determined.
+539 * @return {int} The bytes that were started.
+540 */
+541 minplayer.players.base.prototype.getBytesStart = function ( callback ) {
+542 return this.bytesStart.get ( callback ) ;
+543 } ;
+544
+545 /**
+546 * Return the bytes of media loaded.
+547 *
+548 * @param {function} callback Called when the bytes loaded is determined.
+549 * @return {int} The amount of bytes loaded.
+550 */
+551 minplayer.players.base.prototype.getBytesLoaded = function ( callback ) {
+552 return this.bytesLoaded.get ( callback ) ;
+553 } ;
+554
+555 /**
+556 * Return the total amount of bytes.
+557 *
+558 * @param {function} callback Called when the bytes total is determined.
+559 * @return {int} The total amount of bytes for this media.
+560 */
+561 minplayer.players.base.prototype.getBytesTotal = function ( callback ) {
+562 return this.bytesTotal.get ( callback ) ;
+563 } ;
+564
+565
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.players.flash.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.players.flash.js.html
new file mode 100644
index 0000000..d02b43d
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.players.flash.js.html
@@ -0,0 +1,115 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /** All the media player implementations */
+ 5 minplayer.players = minplayer.players || { } ;
+ 6
+ 7 /**
+ 8 * @constructor
+ 9 * @extends minplayer.display
+ 10 * @class The Flash media player class to control the flash fallback.
+ 11 *
+ 12 * @param {object} context The jQuery context.
+ 13 * @param {object} options This components options.
+ 14 */
+ 15 minplayer.players.flash = function ( context , options ) {
+ 16
+ 17 // Derive from players base.
+ 18 minplayer.players.base.call ( this , context , options ) ;
+ 19 } ;
+ 20
+ 21 /** Derive from minplayer.players.base. */
+ 22 minplayer.players.flash.prototype = new minplayer.players.base ( ) ;
+ 23
+ 24 /** Reset the constructor. */
+ 25 minplayer.players.flash.prototype.constructor = minplayer.players.flash ;
+ 26
+ 27 /**
+ 28 * @see minplayer.players.base#getPriority
+ 29 * @return {number} The priority of this media player.
+ 30 */
+ 31 minplayer.players.flash.getPriority = function ( ) {
+ 32 return 0 ;
+ 33 } ;
+ 34
+ 35 /**
+ 36 * @see minplayer.players.base#canPlay
+ 37 * @return {boolean} If this player can play this media type.
+ 38 */
+ 39 minplayer.players.flash.canPlay = function ( file ) {
+ 40 return false ;
+ 41 } ;
+ 42
+ 43 /**
+ 44 * API to return the Flash player code provided params.
+ 45 *
+ 46 * @param {object} params The params used to populate the Flash code.
+ 47 * @return {object} A Flash DOM element.
+ 48 */
+ 49 minplayer.players.flash.getFlash = function ( params ) {
+ 50 // Get the protocol.
+ 51 var protocol = window.location.protocol ;
+ 52 if ( protocol.charAt ( protocol.length - 1 ) == ':' ) {
+ 53 protocol = protocol.substring ( 0 , protocol.length - 1 ) ;
+ 54 }
+ 55
+ 56 // Convert the flashvars object to a string...
+ 57 var flashVars = jQuery.param ( params.flashvars ) ;
+ 58
+ 59 // Set the codebase.
+ 60 var codebase = protocol + '://fpdownload.macromedia.com' ;
+ 61 codebase + = '/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' ;
+ 62
+ 63 // Get the HTML flash object string.
+ 64 var flash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' ;
+ 65 flash + = 'codebase="' + codebase + '" ' ;
+ 66 flash + = 'playerType="flash" ' ;
+ 67 flash + = 'width="' + params.width + '" ' ;
+ 68 flash + = 'height="' + params.height + '" ' ;
+ 69 flash + = 'id="' + params.id + '" ' ;
+ 70 flash + = 'name="' + params.id + '"> ' ;
+ 71 flash + = '<param name="allowScriptAccess" value="always"></param>' ;
+ 72 flash + = '<param name="allowfullscreen" value="true" />' ;
+ 73 flash + = '<param name="movie" value="' + params.swf + '"></param>' ;
+ 74 flash + = '<param name="wmode" value="' + params.wmode + '"></param>' ;
+ 75 flash + = '<param name="quality" value="high"></param>' ;
+ 76 flash + = '<param name="FlashVars" value="' + flashVars + '"></param>' ;
+ 77 flash + = '<embed src="' + params.swf + '" ' ;
+ 78 flash + = 'quality="high" ' ;
+ 79 flash + = 'width="' + params.width + '" height="' + params.height + '" ' ;
+ 80 flash + = 'id="' + params.id + '" name="' + params.id + '" ' ;
+ 81 flash + = 'swLiveConnect="true" allowScriptAccess="always" ' ;
+ 82 flash + = 'wmode="' + params.wmode + '"' ;
+ 83 flash + = 'allowfullscreen="true" type="application/x-shockwave-flash" ' ;
+ 84 flash + = 'FlashVars="' + flashVars + '" ' ;
+ 85 flash + = 'pluginspage="' + protocol ;
+ 86 flash + = '://www.macromedia.com/go/getflashplayer" />' ;
+ 87 flash + = '</object>' ;
+ 88 return flash ;
+ 89 } ;
+ 90
+ 91 /**
+ 92 * @see minplayer.players.base#playerFound
+ 93 * @return {boolean} TRUE - if the player is in the DOM, FALSE otherwise.
+ 94 */
+ 95 minplayer.players.flash.prototype.playerFound = function ( ) {
+ 96 return ( this.display.find ( 'object[playerType="flash"]' ) . length > 0 ) ;
+ 97 } ;
+ 98
+ 99 /**
+100 * @see minplayer.players.base#getPlayer
+101 * @return {object} The media player object.
+102 */
+103 minplayer.players.flash.prototype.getPlayer = function ( ) {
+104 // IE needs the object, everyone else just needs embed.
+105 var object = jQuery.browser.msie ? 'object' : 'embed' ;
+106 return jQuery ( object , this.display ) . eq ( 0 ) [ 0 ] ;
+107 } ;
+108
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.players.html5.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.players.html5.js.html
new file mode 100644
index 0000000..a9dd85f
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.players.html5.js.html
@@ -0,0 +1,320 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /** All the media player implementations */
+ 5 minplayer.players = minplayer.players || { } ;
+ 6
+ 7 /**
+ 8 * @constructor
+ 9 * @extends minplayer.display
+ 10 * @class The HTML5 media player implementation.
+ 11 *
+ 12 * @param {object} context The jQuery context.
+ 13 * @param {object} options This components options.
+ 14 */
+ 15 minplayer.players.html5 = function ( context , options ) {
+ 16
+ 17 // Derive players base.
+ 18 minplayer.players.base.call ( this , context , options ) ;
+ 19 } ;
+ 20
+ 21 /** Derive from minplayer.players.base. */
+ 22 minplayer.players.html5.prototype = new minplayer.players.base ( ) ;
+ 23
+ 24 /** Reset the constructor. */
+ 25 minplayer.players.html5.prototype.constructor = minplayer.players.html5 ;
+ 26
+ 27 /**
+ 28 * @see minplayer.players.base#getPriority
+ 29 * @return {number} The priority of this media player.
+ 30 */
+ 31 minplayer.players.html5.getPriority = function ( ) {
+ 32 return 10 ;
+ 33 } ;
+ 34
+ 35 /**
+ 36 * @see minplayer.players.base#canPlay
+ 37 * @return {boolean} If this player can play this media type.
+ 38 */
+ 39 minplayer.players.html5.canPlay = function ( file ) {
+ 40 switch ( file.mimetype ) {
+ 41 case 'video/ogg' :
+ 42 return ! ! minplayer.playTypes.videoOGG ;
+ 43 case 'video/mp4' :
+ 44 return ! ! minplayer.playTypes.videoH264 ;
+ 45 case 'video/x-webm' :
+ 46 case 'video/webm' :
+ 47 case 'application/octet-stream' :
+ 48 return ! ! minplayer.playTypes.videoWEBM ;
+ 49 case 'audio/ogg' :
+ 50 return ! ! minplayer.playTypes.audioOGG ;
+ 51 case 'audio/mpeg' :
+ 52 return ! ! minplayer.playTypes.audioMP3 ;
+ 53 case 'audio/mp4' :
+ 54 return ! ! minplayer.playTypes.audioMP4 ;
+ 55 default :
+ 56 return false ;
+ 57 }
+ 58 } ;
+ 59
+ 60 /**
+ 61 * @see minplayer.plugin.construct
+ 62 */
+ 63 minplayer.players.html5.prototype.construct = function ( ) {
+ 64
+ 65 // Call base constructor.
+ 66 minplayer.players.base.prototype.construct.call ( this ) ;
+ 67
+ 68 // Store the this pointer...
+ 69 var _this = this ;
+ 70
+ 71 // For the HTML5 player, we will just pass events along...
+ 72 if ( this.player ) {
+ 73
+ 74 this.player.addEventListener ( 'abort' , function ( ) {
+ 75 _this.trigger ( 'abort' ) ;
+ 76 } , false ) ;
+ 77 this.player.addEventListener ( 'loadstart' , function ( ) {
+ 78 _this.onReady ( ) ;
+ 79 } , false ) ;
+ 80 this.player.addEventListener ( 'loadeddata' , function ( ) {
+ 81 _this.onLoaded ( ) ;
+ 82 } , false ) ;
+ 83 this.player.addEventListener ( 'loadedmetadata' , function ( ) {
+ 84 _this.onLoaded ( ) ;
+ 85 } , false ) ;
+ 86 this.player.addEventListener ( 'canplaythrough' , function ( ) {
+ 87 _this.onLoaded ( ) ;
+ 88 } , false ) ;
+ 89 this.player.addEventListener ( 'ended' , function ( ) {
+ 90 _this.onComplete ( ) ;
+ 91 } , false ) ;
+ 92 this.player.addEventListener ( 'pause' , function ( ) {
+ 93 _this.onPaused ( ) ;
+ 94 } , false ) ;
+ 95 this.player.addEventListener ( 'play' , function ( ) {
+ 96 _this.onPlaying ( ) ;
+ 97 } , false ) ;
+ 98 this.player.addEventListener ( 'playing' , function ( ) {
+ 99 _this.onPlaying ( ) ;
+100 } , false ) ;
+101 this.player.addEventListener ( 'error' , function ( ) {
+102 _this.trigger ( 'error' , 'An error occured - ' + this.error.code ) ;
+103 } , false ) ;
+104 this.player.addEventListener ( 'waiting' , function ( ) {
+105 _this.onWaiting ( ) ;
+106 } , false ) ;
+107 this.player.addEventListener ( 'durationchange' , function ( ) {
+108 _this.duration.set ( this.duration ) ;
+109 _this.trigger ( 'durationchange' , { duration : this.duration } ) ;
+110 } , false ) ;
+111 this.player.addEventListener ( 'progress' , function ( event ) {
+112 _this.bytesTotal.set ( event.total ) ;
+113 _this.bytesLoaded.set ( event.loaded ) ;
+114 } , false ) ;
+115 }
+116 } ;
+117
+118 /**
+119 * @see minplayer.players.base#playerFound
+120 * @return {boolean} TRUE - if the player is in the DOM, FALSE otherwise.
+121 */
+122 minplayer.players.html5.prototype.playerFound = function ( ) {
+123 return ( this.display.find ( this.mediaFile.type ) . length > 0 ) ;
+124 } ;
+125
+126 /**
+127 * @see minplayer.players.base#create
+128 * @return {object} The media player entity.
+129 */
+130 minplayer.players.html5.prototype.create = function ( ) {
+131 minplayer.players.base.prototype.create.call ( this ) ;
+132 var element = jQuery ( document.createElement ( this.mediaFile.type ) )
+133 . attr ( this.options.attributes )
+134 . append (
+135 jQuery ( document.createElement ( 'source' ) ) . attr ( {
+136 'src' : this.mediaFile.path
+137 } )
+138 ) ;
+139
+140 // Fix the fluid width and height.
+141 element.eq ( 0 ) [ 0 ] . setAttribute ( 'width' , '100%' ) ;
+142 element.eq ( 0 ) [ 0 ] . setAttribute ( 'height' , '100%' ) ;
+143 return element ;
+144 } ;
+145
+146 /**
+147 * @see minplayer.players.base#getPlayer
+148 * @return {object} The media player object.
+149 */
+150 minplayer.players.html5.prototype.getPlayer = function ( ) {
+151 return this.options.elements.media.eq ( 0 ) [ 0 ] ;
+152 } ;
+153
+154 /**
+155 * @see minplayer.players.base#load
+156 */
+157 minplayer.players.html5.prototype.load = function ( file ) {
+158
+159 if ( file && this.isReady ( ) ) {
+160
+161 // Get the current source.
+162 var src = this.options.elements.media.attr ( 'src' ) ;
+163
+164 // If the source is different.
+165 if ( src != file.path ) {
+166
+167 // Change the source...
+168 var code = '<source src="' + file.path + '" ' ;
+169 code + = 'type="' + file.mimetype + '"' ;
+170 code + = file.codecs ? ' codecs="' + file.path + '">' : '>' ;
+171 this.options.elements.media.attr ( 'src' , '' ) . empty ( ) . html ( code ) ;
+172 }
+173 }
+174
+175 // Always call the base first on load...
+176 minplayer.players.base.prototype.load.call ( this , file ) ;
+177 } ;
+178
+179 /**
+180 * @see minplayer.players.base#play
+181 */
+182 minplayer.players.html5.prototype.play = function ( ) {
+183 minplayer.players.base.prototype.play.call ( this ) ;
+184 if ( this.isReady ( ) ) {
+185 this.player.play ( ) ;
+186 }
+187 } ;
+188
+189 /**
+190 * @see minplayer.players.base#pause
+191 */
+192 minplayer.players.html5.prototype.pause = function ( ) {
+193 minplayer.players.base.prototype.pause.call ( this ) ;
+194 if ( this.isReady ( ) ) {
+195 this.player.pause ( ) ;
+196 }
+197 } ;
+198
+199 /**
+200 * @see minplayer.players.base#stop
+201 */
+202 minplayer.players.html5.prototype.stop = function ( ) {
+203 minplayer.players.base.prototype.stop.call ( this ) ;
+204 if ( this.isReady ( ) ) {
+205 this.player.pause ( ) ;
+206 this.player.src = '' ;
+207 }
+208 } ;
+209
+210 /**
+211 * @see minplayer.players.base#seek
+212 */
+213 minplayer.players.html5.prototype.seek = function ( pos ) {
+214 minplayer.players.base.prototype.seek.call ( this , pos ) ;
+215 if ( this.isReady ( ) ) {
+216 this.player.currentTime = pos ;
+217 }
+218 } ;
+219
+220 /**
+221 * @see minplayer.players.base#setVolume
+222 */
+223 minplayer.players.html5.prototype.setVolume = function ( vol ) {
+224 minplayer.players.base.prototype.setVolume.call ( this , vol ) ;
+225 if ( this.isReady ( ) ) {
+226 this.player.volume = vol ;
+227 }
+228 } ;
+229
+230 /**
+231 * @see minplayer.players.base#getVolume
+232 */
+233 minplayer.players.html5.prototype.getVolume = function ( callback ) {
+234 if ( this.isReady ( ) ) {
+235 callback ( this.player.volume ) ;
+236 }
+237 } ;
+238
+239 /**
+240 * @see minplayer.players.base#getDuration
+241 */
+242 minplayer.players.html5.prototype.getDuration = function ( callback ) {
+243 if ( this.isReady ( ) ) {
+244 callback ( this.player.duration ) ;
+245 }
+246 } ;
+247
+248 /**
+249 * @see minplayer.players.base#getCurrentTime
+250 */
+251 minplayer.players.html5.prototype.getCurrentTime = function ( callback ) {
+252 if ( this.isReady ( ) ) {
+253 callback ( this.player.currentTime ) ;
+254 }
+255 } ;
+256
+257 /**
+258 * @see minplayer.players.base#getBytesLoaded
+259 */
+260 minplayer.players.html5.prototype.getBytesLoaded = function ( callback ) {
+261 if ( this.isReady ( ) ) {
+262 var loaded = 0 ;
+263
+264 // Check several different possibilities.
+265 if ( this.bytesLoaded.value ) {
+266 loaded = this.bytesLoaded.value ;
+267 }
+268 else if ( this.player.buffered &&
+269 this.player.buffered.length > 0 &&
+270 this.player.buffered.end &&
+271 this.player.duration ) {
+272 loaded = this.player.buffered.end ( 0 ) ;
+273 }
+274 else if ( this.player.bytesTotal != undefined &&
+275 this.player.bytesTotal > 0 &&
+276 this.player.bufferedBytes != undefined ) {
+277 loaded = this.player.bufferedBytes ;
+278 }
+279
+280 // Return the loaded amount.
+281 callback ( loaded ) ;
+282 }
+283 } ;
+284
+285 /**
+286 * @see minplayer.players.base#getBytesTotal
+287 */
+288 minplayer.players.html5.prototype.getBytesTotal = function ( callback ) {
+289 if ( this.isReady ( ) ) {
+290
+291 var total = 0 ;
+292
+293 // Check several different possibilities.
+294 if ( this.bytesTotal.value ) {
+295 total = this.bytesTotal.value ;
+296 }
+297 else if ( this.player.buffered &&
+298 this.player.buffered.length > 0 &&
+299 this.player.buffered.end &&
+300 this.player.duration ) {
+301 total = this.player.duration ;
+302 }
+303 else if ( this.player.bytesTotal != undefined &&
+304 this.player.bytesTotal > 0 &&
+305 this.player.bufferedBytes != undefined ) {
+306 total = this.player.bytesTotal ;
+307 }
+308
+309 // Return the loaded amount.
+310 callback ( total ) ;
+311 }
+312 } ;
+313
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.players.minplayer.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.players.minplayer.js.html
new file mode 100644
index 0000000..455dd86
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.players.minplayer.js.html
@@ -0,0 +1,274 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /** All the media player implementations */
+ 5 minplayer.players = minplayer.players || { } ;
+ 6
+ 7 /**
+ 8 * @constructor
+ 9 * @extends minplayer.display
+ 10 * @class The Flash media player class to control the flash fallback.
+ 11 *
+ 12 * @param {object} context The jQuery context.
+ 13 * @param {object} options This components options.
+ 14 */
+ 15 minplayer.players.minplayer = function ( context , options ) {
+ 16
+ 17 // Derive from players flash.
+ 18 minplayer.players.flash.call ( this , context , options ) ;
+ 19 } ;
+ 20
+ 21 /** Derive from minplayer.players.flash. */
+ 22 minplayer.players.minplayer.prototype = new minplayer.players.flash ( ) ;
+ 23
+ 24 /** Reset the constructor. */
+ 25 minplayer.players.minplayer.prototype.constructor = minplayer.players.minplayer ;
+ 26
+ 27 /**
+ 28 * Called when the Flash player is ready.
+ 29 *
+ 30 * @param {string} id The media player ID.
+ 31 */
+ 32 window.onFlashPlayerReady = function ( id ) {
+ 33 var media = minplayer.get ( id , 'media' ) ;
+ 34 if ( media ) {
+ 35 media.onReady ( ) ;
+ 36 }
+ 37 } ;
+ 38
+ 39 /**
+ 40 * Called when the Flash player updates.
+ 41 *
+ 42 * @param {string} id The media player ID.
+ 43 * @param {string} eventType The event type that was triggered.
+ 44 */
+ 45 window.onFlashPlayerUpdate = function ( id , eventType ) {
+ 46 var media = minplayer.get ( id , 'media' ) ;
+ 47 if ( media ) {
+ 48 media.onMediaUpdate ( eventType ) ;
+ 49 }
+ 50 } ;
+ 51
+ 52 /**
+ 53 * Used to debug from the Flash player to the browser console.
+ 54 *
+ 55 * @param {string} debug The debug string.
+ 56 */
+ 57 window.onFlashPlayerDebug = function ( debug ) {
+ 58 minplayer.console.log ( debug ) ;
+ 59 } ;
+ 60
+ 61 /**
+ 62 * @see minplayer.players.base#getPriority
+ 63 * @return {number} The priority of this media player.
+ 64 */
+ 65 minplayer.players.minplayer.getPriority = function ( ) {
+ 66 return 1 ;
+ 67 } ;
+ 68
+ 69 /**
+ 70 * @see minplayer.players.base#canPlay
+ 71 * @return {boolean} If this player can play this media type.
+ 72 */
+ 73 minplayer.players.minplayer.canPlay = function ( file ) {
+ 74 switch ( file.mimetype ) {
+ 75 case 'video/mp4' :
+ 76 case 'video/x-webm' :
+ 77 case 'video/webm' :
+ 78 case 'application/octet-stream' :
+ 79 case 'video/quicktime' :
+ 80 case 'video/3gpp2' :
+ 81 case 'video/3gpp' :
+ 82 case 'application/x-shockwave-flash' :
+ 83 case 'audio/mpeg' :
+ 84 case 'audio/mp4' :
+ 85 case 'audio/aac' :
+ 86 case 'audio/vnd.wave' :
+ 87 case 'audio/x-ms-wma' :
+ 88 return true ;
+ 89
+ 90 default :
+ 91 return false ;
+ 92 }
+ 93 } ;
+ 94
+ 95 /**
+ 96 * @see minplayer.players.base#create
+ 97 * @return {object} The media player entity.
+ 98 */
+ 99 minplayer.players.minplayer.prototype.create = function ( ) {
+100 minplayer.players.flash.prototype.create.call ( this ) ;
+101
+102 // The flash variables for this flash player.
+103 var flashVars = {
+104 'id' : this.options.id ,
+105 'debug' : this.options.debug ,
+106 'config' : 'nocontrols' ,
+107 'file' : this.mediaFile.path ,
+108 'autostart' : this.options.autoplay
+109 } ;
+110
+111 // Return a flash media player object.
+112 return minplayer.players.flash.getFlash ( {
+113 swf : this.options.swfplayer ,
+114 id : this.options.id + '_player' ,
+115 width : this.options.width ,
+116 height : '100%' ,
+117 flashvars : flashVars ,
+118 wmode : this.options.wmode
+119 } ) ;
+120 } ;
+121
+122 /**
+123 * Called when the Flash player has an update.
+124 *
+125 * @param {string} eventType The event that was triggered in the player.
+126 */
+127 minplayer.players.minplayer.prototype.onMediaUpdate = function ( eventType ) {
+128 switch ( eventType ) {
+129 case 'mediaMeta' :
+130 this.onLoaded ( ) ;
+131 break ;
+132 case 'mediaPlaying' :
+133 this.onPlaying ( ) ;
+134 break ;
+135 case 'mediaPaused' :
+136 this.onPaused ( ) ;
+137 break ;
+138 case 'mediaComplete' :
+139 this.onComplete ( ) ;
+140 break ;
+141 }
+142 } ;
+143
+144 /**
+145 * @see minplayer.players.base#load
+146 */
+147 minplayer.players.minplayer.prototype.load = function ( file ) {
+148 minplayer.players.flash.prototype.load.call ( this , file ) ;
+149 if ( file && this.isReady ( ) ) {
+150 this.player.loadMedia ( file.path , file.stream ) ;
+151 }
+152 } ;
+153
+154 /**
+155 * @see minplayer.players.base#play
+156 */
+157 minplayer.players.minplayer.prototype.play = function ( ) {
+158 minplayer.players.flash.prototype.play.call ( this ) ;
+159 if ( this.isReady ( ) ) {
+160 this.player.playMedia ( ) ;
+161 }
+162 } ;
+163
+164 /**
+165 * @see minplayer.players.base#pause
+166 */
+167 minplayer.players.minplayer.prototype.pause = function ( ) {
+168 minplayer.players.flash.prototype.pause.call ( this ) ;
+169 if ( this.isReady ( ) ) {
+170 this.player.pauseMedia ( ) ;
+171 }
+172 } ;
+173
+174 /**
+175 * @see minplayer.players.base#stop
+176 */
+177 minplayer.players.minplayer.prototype.stop = function ( ) {
+178 minplayer.players.flash.prototype.stop.call ( this ) ;
+179 if ( this.isReady ( ) ) {
+180 this.player.stopMedia ( ) ;
+181 }
+182 } ;
+183
+184 /**
+185 * @see minplayer.players.base#seek
+186 */
+187 minplayer.players.minplayer.prototype.seek = function ( pos ) {
+188 minplayer.players.flash.prototype.seek.call ( this , pos ) ;
+189 if ( this.isReady ( ) ) {
+190 this.player.seekMedia ( pos ) ;
+191 }
+192 } ;
+193
+194 /**
+195 * @see minplayer.players.base#setVolume
+196 */
+197 minplayer.players.minplayer.prototype.setVolume = function ( vol ) {
+198 minplayer.players.flash.prototype.setVolume.call ( this , vol ) ;
+199 if ( this.isReady ( ) ) {
+200 this.player.setVolume ( vol ) ;
+201 }
+202 } ;
+203
+204 /**
+205 * @see minplayer.players.base#getVolume
+206 */
+207 minplayer.players.minplayer.prototype.getVolume = function ( callback ) {
+208 if ( this.isReady ( ) ) {
+209 callback ( this.player.getVolume ( ) ) ;
+210 }
+211 } ;
+212
+213 /**
+214 * @see minplayer.players.flash#getDuration
+215 */
+216 minplayer.players.minplayer.prototype.getDuration = function ( callback ) {
+217 if ( this.isReady ( ) ) {
+218
+219 // Check to see if it is immediately available.
+220 var duration = this.player.getDuration ( ) ;
+221 if ( duration ) {
+222 callback ( duration ) ;
+223 }
+224 else {
+225
+226 // If not, then check every half second...
+227 var _this = this ;
+228 setTimeout ( function check ( ) {
+229 duration = _this.player.getDuration ( ) ;
+230 if ( duration ) {
+231 callback ( duration ) ;
+232 }
+233 else {
+234 setTimeout ( check , 500 ) ;
+235 }
+236 } , 500 ) ;
+237 }
+238 }
+239 } ;
+240
+241 /**
+242 * @see minplayer.players.base#getCurrentTime
+243 */
+244 minplayer.players.minplayer.prototype.getCurrentTime = function ( callback ) {
+245 if ( this.isReady ( ) ) {
+246 callback ( this.player.getCurrentTime ( ) ) ;
+247 }
+248 } ;
+249
+250 /**
+251 * @see minplayer.players.base#getBytesLoaded
+252 */
+253 minplayer.players.minplayer.prototype.getBytesLoaded = function ( callback ) {
+254 if ( this.isReady ( ) ) {
+255 callback ( this.player.getMediaBytesLoaded ( ) ) ;
+256 }
+257 } ;
+258
+259 /**
+260 * @see minplayer.players.base#getBytesTotal.
+261 */
+262 minplayer.players.minplayer.prototype.getBytesTotal = function ( callback ) {
+263 if ( this.isReady ( ) ) {
+264 callback ( this.player.getMediaBytesTotal ( ) ) ;
+265 }
+266 } ;
+267
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.players.vimeo.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.players.vimeo.js.html
new file mode 100644
index 0000000..d53902a
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.players.vimeo.js.html
@@ -0,0 +1,267 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /** All the media player implementations */
+ 5 minplayer.players = minplayer.players || { } ;
+ 6
+ 7 /**
+ 8 * @constructor
+ 9 * @extends minplayer.players.base
+ 10 * @class The vimeo media player.
+ 11 *
+ 12 * @param {object} context The jQuery context.
+ 13 * @param {object} options This components options.
+ 14 */
+ 15 minplayer.players.vimeo = function ( context , options ) {
+ 16
+ 17 // Derive from players base.
+ 18 minplayer.players.base.call ( this , context , options ) ;
+ 19 } ;
+ 20
+ 21 /** Derive from minplayer.players.base. */
+ 22 minplayer.players.vimeo.prototype = new minplayer.players.base ( ) ;
+ 23
+ 24 /** Reset the constructor. */
+ 25 minplayer.players.vimeo.prototype.constructor = minplayer.players.vimeo ;
+ 26
+ 27 /**
+ 28 * @see minplayer.players.base#getPriority
+ 29 * @return {number} The priority of this media player.
+ 30 */
+ 31 minplayer.players.vimeo.getPriority = function ( ) {
+ 32 return 10 ;
+ 33 } ;
+ 34
+ 35 /**
+ 36 * @see minplayer.players.base#canPlay
+ 37 * @return {boolean} If this player can play this media type.
+ 38 */
+ 39 minplayer.players.vimeo.canPlay = function ( file ) {
+ 40
+ 41 // Check for the mimetype for vimeo.
+ 42 if ( file.mimetype === 'video/vimeo' ) {
+ 43 return true ;
+ 44 }
+ 45
+ 46 // If the path is a vimeo path, then return true.
+ 47 return ( file.path.search ( /^http(s)?\:\/\/(www\.)?vimeo\.com/i ) === 0 ) ;
+ 48 } ;
+ 49
+ 50 /**
+ 51 * Return the ID for a provided media file.
+ 52 *
+ 53 * @param {object} file A {@link minplayer.file} object.
+ 54 * @return {string} The ID for the provided media.
+ 55 */
+ 56 minplayer.players.vimeo.getMediaId = function ( file ) {
+ 57 var regex = /^http[s]?\:\/\/(www\.)?vimeo\.com\/(\?v\=)?([0-9]+)/i ;
+ 58 if ( file.path.search ( regex ) === 0 ) {
+ 59 return file.path.replace ( regex , '$3' ) ;
+ 60 }
+ 61 else {
+ 62 return file.path ;
+ 63 }
+ 64 } ;
+ 65
+ 66 /**
+ 67 * @see minplayer.players.base#reset
+ 68 */
+ 69 minplayer.players.vimeo.prototype.reset = function ( ) {
+ 70
+ 71 // Reset the flash variables..
+ 72 minplayer.players.base.prototype.reset.call ( this ) ;
+ 73 } ;
+ 74
+ 75 /**
+ 76 * @see minplayer.players.base#create
+ 77 * @return {object} The media player entity.
+ 78 */
+ 79 minplayer.players.vimeo.prototype.create = function ( ) {
+ 80 minplayer.players.base.prototype.create.call ( this ) ;
+ 81
+ 82 // Insert the Vimeo Froogaloop player.
+ 83 var tag = document.createElement ( 'script' ) ;
+ 84 tag.src = 'http://a.vimeocdn.com/js/froogaloop2.min.js' ;
+ 85 var firstScriptTag = document.getElementsByTagName ( 'script' ) [ 0 ] ;
+ 86 firstScriptTag.parentNode.insertBefore ( tag , firstScriptTag ) ;
+ 87
+ 88 // Create the iframe for this player.
+ 89 var iframe = document.createElement ( 'iframe' ) ;
+ 90 iframe.setAttribute ( 'id' , this.options.id + '-player' ) ;
+ 91 iframe.setAttribute ( 'type' , 'text/html' ) ;
+ 92 iframe.setAttribute ( 'width' , '100%' ) ;
+ 93 iframe.setAttribute ( 'height' , '100%' ) ;
+ 94 iframe.setAttribute ( 'frameborder' , '0' ) ;
+ 95
+ 96 // Get the source.
+ 97 var src = 'http://player.vimeo.com/video/' ;
+ 98 src + = this.mediaFile.id + '?' ;
+ 99
+100 // Add the parameters to the src.
+101 src + = jQuery.param ( {
+102 'wmode' : 'opaque' ,
+103 'api' : 1 ,
+104 'player_id' : this.options.id + '-player' ,
+105 'title' : 0 ,
+106 'byline' : 0 ,
+107 'portrait' : 0 ,
+108 'autoplay' : this.options.autoplay ,
+109 'loop' : this.options.loop
+110 } ) ;
+111
+112 // Set the source of the iframe.
+113 iframe.setAttribute ( 'src' , src ) ;
+114
+115 // Now register this player when the froogaloop code is loaded.
+116 var _this = this ;
+117 setTimeout ( function check ( ) {
+118 if ( window.Froogaloop ) {
+119 _this.player = window.Froogaloop ( iframe ) ;
+120 _this.player.addEvent ( 'ready' , function ( ) {
+121 _this.onReady ( ) ;
+122 } ) ;
+123 }
+124 else {
+125 setTimeout ( check , 200 ) ;
+126 }
+127 } , 200 ) ;
+128
+129 // Trigger that the load has started.
+130 this.trigger ( 'loadstart' ) ;
+131
+132 // Return the player.
+133 return iframe ;
+134 } ;
+135
+136 /**
+137 * @see minplayer.players.base#onReady
+138 */
+139 minplayer.players.vimeo.prototype.onReady = function ( player_id ) {
+140 // Store the this pointer within this context.
+141 var _this = this ;
+142
+143 // Add the other listeners.
+144 this.player.addEvent ( 'loadProgress' , function ( progress ) {
+145
+146 // Set the duration, bytesLoaded, and bytesTotal.
+147 _this.duration.set ( parseFloat ( progress.duration ) ) ;
+148 _this.bytesLoaded.set ( progress.bytesLoaded ) ;
+149 _this.bytesTotal.set ( progress.bytesTotal ) ;
+150 } ) ;
+151
+152 this.player.addEvent ( 'playProgress' , function ( progress ) {
+153
+154 // Set the duration and current time.
+155 _this.duration.set ( parseFloat ( progress.duration ) ) ;
+156 _this.currentTime.set ( parseFloat ( progress.seconds ) ) ;
+157 } ) ;
+158
+159 this.player.addEvent ( 'play' , function ( ) {
+160 _this.onPlaying ( ) ;
+161 } ) ;
+162
+163 this.player.addEvent ( 'pause' , function ( ) {
+164 _this.onPaused ( ) ;
+165 } ) ;
+166
+167 this.player.addEvent ( 'finish' , function ( ) {
+168 _this.onComplete ( ) ;
+169 } ) ;
+170
+171 minplayer.players.base.prototype.onReady.call ( this ) ;
+172 this.onLoaded ( ) ;
+173 } ;
+174
+175 /**
+176 * Checks to see if this player can be found.
+177 * @return {bool} TRUE - Player is found, FALSE - otherwise.
+178 */
+179 minplayer.players.vimeo.prototype.playerFound = function ( ) {
+180 var iframe = this.display.find ( 'iframe#' + this.options.id + '-player' ) ;
+181 return ( iframe.length > 0 ) ;
+182 } ;
+183
+184 /**
+185 * @see minplayer.players.base#play
+186 */
+187 minplayer.players.vimeo.prototype.play = function ( ) {
+188 minplayer.players.base.prototype.play.call ( this ) ;
+189 if ( this.isReady ( ) ) {
+190 this.player.api ( 'play' ) ;
+191 }
+192 } ;
+193
+194 /**
+195 * @see minplayer.players.base#pause
+196 */
+197 minplayer.players.vimeo.prototype.pause = function ( ) {
+198 minplayer.players.base.prototype.pause.call ( this ) ;
+199 if ( this.isReady ( ) ) {
+200 this.player.api ( 'pause' ) ;
+201 }
+202 } ;
+203
+204 /**
+205 * @see minplayer.players.base#stop
+206 */
+207 minplayer.players.vimeo.prototype.stop = function ( ) {
+208 minplayer.players.base.prototype.stop.call ( this ) ;
+209 if ( this.isReady ( ) ) {
+210 this.player.api ( 'unload' ) ;
+211 }
+212 } ;
+213
+214 /**
+215 * @see minplayer.players.base#seek
+216 */
+217 minplayer.players.vimeo.prototype.seek = function ( pos ) {
+218 minplayer.players.base.prototype.seek.call ( this , pos ) ;
+219 if ( this.isReady ( ) ) {
+220 this.player.api ( 'seekTo' , pos ) ;
+221 }
+222 } ;
+223
+224 /**
+225 * @see minplayer.players.base#setVolume
+226 */
+227 minplayer.players.vimeo.prototype.setVolume = function ( vol ) {
+228 minplayer.players.base.prototype.setVolume.call ( this , vol ) ;
+229 if ( this.isReady ( ) ) {
+230 this.volume.set ( vol ) ;
+231 this.player.api ( 'setVolume' , vol ) ;
+232 }
+233 } ;
+234
+235 /**
+236 * @see minplayer.players.base#getVolume
+237 */
+238 minplayer.players.vimeo.prototype.getVolume = function ( callback ) {
+239 var _this = this ;
+240 this.player.api ( 'getVolume' , function ( vol ) {
+241 callback ( vol ) ;
+242 } ) ;
+243 } ;
+244
+245 /**
+246 * @see minplayer.players.base#getDuration.
+247 */
+248 minplayer.players.vimeo.prototype.getDuration = function ( callback ) {
+249 if ( this.isReady ( ) ) {
+250 if ( this.duration.value ) {
+251 callback ( this.duration.value ) ;
+252 }
+253 else {
+254 this.player.api ( 'getDuration' , function ( duration ) {
+255 callback ( duration ) ;
+256 } ) ;
+257 }
+258 }
+259 } ;
+260
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.players.youtube.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.players.youtube.js.html
new file mode 100644
index 0000000..4476ed6
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.players.youtube.js.html
@@ -0,0 +1,353 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /** All the media player implementations */
+ 5 minplayer.players = minplayer.players || { } ;
+ 6
+ 7 /**
+ 8 * @constructor
+ 9 * @extends minplayer.players.base
+ 10 * @class The YouTube media player.
+ 11 *
+ 12 * @param {object} context The jQuery context.
+ 13 * @param {object} options This components options.
+ 14 */
+ 15 minplayer.players.youtube = function ( context , options ) {
+ 16
+ 17 /** The quality of the YouTube stream. */
+ 18 this.quality = 'default' ;
+ 19
+ 20 // Derive from players base.
+ 21 minplayer.players.base.call ( this , context , options ) ;
+ 22 } ;
+ 23
+ 24 /** Derive from minplayer.players.base. */
+ 25 minplayer.players.youtube.prototype = new minplayer.players.base ( ) ;
+ 26
+ 27 /** Reset the constructor. */
+ 28 minplayer.players.youtube.prototype.constructor = minplayer.players.youtube ;
+ 29
+ 30 /**
+ 31 * @see minplayer.players.base#getPriority
+ 32 * @return {number} The priority of this media player.
+ 33 */
+ 34 minplayer.players.youtube.getPriority = function ( ) {
+ 35 return 10 ;
+ 36 } ;
+ 37
+ 38 /**
+ 39 * @see minplayer.players.base#canPlay
+ 40 * @return {boolean} If this player can play this media type.
+ 41 */
+ 42 minplayer.players.youtube.canPlay = function ( file ) {
+ 43
+ 44 // Check for the mimetype for youtube.
+ 45 if ( file.mimetype === 'video/youtube' ) {
+ 46 return true ;
+ 47 }
+ 48
+ 49 // If the path is a YouTube path, then return true.
+ 50 return ( file.path.search ( /^http(s)?\:\/\/(www\.)?youtube\.com/i ) === 0 ) ;
+ 51 } ;
+ 52
+ 53 /**
+ 54 * Return the ID for a provided media file.
+ 55 *
+ 56 * @param {object} file A {@link minplayer.file} object.
+ 57 * @return {string} The ID for the provided media.
+ 58 */
+ 59 minplayer.players.youtube.getMediaId = function ( file ) {
+ 60 var regex = /^http[s]?\:\/\/(www\.)?youtube\.com\/watch\?v=([a-zA-Z0-9]+)/i ;
+ 61 if ( file.path.search ( regex ) === 0 ) {
+ 62 return file.path.replace ( regex , '$2' ) ;
+ 63 }
+ 64 else {
+ 65 return file.path ;
+ 66 }
+ 67 } ;
+ 68
+ 69 /**
+ 70 * Register this youtube player so that multiple players can be present
+ 71 * on the same page without event collision.
+ 72 */
+ 73 minplayer.players.youtube.prototype.register = function ( ) {
+ 74
+ 75 /**
+ 76 * Register the standard youtube api ready callback.
+ 77 */
+ 78 window.onYouTubePlayerAPIReady = function ( ) {
+ 79
+ 80 // Iterate over each media player.
+ 81 jQuery.each ( minplayer.get ( null , 'player' ) , function ( id , player ) {
+ 82
+ 83 // Make sure this is the youtube player.
+ 84 if ( player.currentPlayer == 'youtube' ) {
+ 85
+ 86 // Create a new youtube player object for this instance only.
+ 87 var playerId = id + '-player' ;
+ 88
+ 89 // Set this players media.
+ 90 player.media.player = new YT.Player ( playerId , {
+ 91 events : {
+ 92 'onReady' : function ( event ) {
+ 93 player.media.onReady ( event ) ;
+ 94 } ,
+ 95 'onStateChange' : function ( event ) {
+ 96 player.media.onPlayerStateChange ( event ) ;
+ 97 } ,
+ 98 'onPlaybackQualityChange' : function ( newQuality ) {
+ 99 player.media.onQualityChange ( newQuality ) ;
+100 } ,
+101 'onError' : function ( errorCode ) {
+102 player.media.onError ( errorCode ) ;
+103 }
+104 }
+105 } ) ;
+106 }
+107 } ) ;
+108 }
+109 } ;
+110
+111 /**
+112 * Translates the player state for the YouTube API player.
+113 *
+114 * @param {number} playerState The YouTube player state.
+115 */
+116 minplayer.players.youtube.prototype.setPlayerState = function ( playerState ) {
+117 switch ( playerState ) {
+118 case YT.PlayerState.CUED :
+119 break ;
+120 case YT.PlayerState.BUFFERING :
+121 this.onWaiting ( ) ;
+122 break ;
+123 case YT.PlayerState.PAUSED :
+124 this.onPaused ( ) ;
+125 break ;
+126 case YT.PlayerState.PLAYING :
+127 this.onPlaying ( ) ;
+128 break ;
+129 case YT.PlayerState.ENDED :
+130 this.onComplete ( ) ;
+131 break ;
+132 default :
+133 break ;
+134 }
+135 } ;
+136
+137 /**
+138 * Called when an error occurs.
+139 *
+140 * @param {string} event The onReady event that was triggered.
+141 */
+142 minplayer.players.youtube.prototype.onReady = function ( event ) {
+143 minplayer.players.base.prototype.onReady.call ( this ) ;
+144 this.onLoaded ( ) ;
+145 } ;
+146
+147 /**
+148 * Checks to see if this player can be found.
+149 * @return {bool} TRUE - Player is found, FALSE - otherwise.
+150 */
+151 minplayer.players.youtube.prototype.playerFound = function ( ) {
+152 var iframe = this.display.find ( 'iframe#' + this.options.id + '-player' ) ;
+153 return ( iframe.length > 0 ) ;
+154 } ;
+155
+156 /**
+157 * Called when the player state changes.
+158 *
+159 * @param {object} event A JavaScript Event.
+160 */
+161 minplayer.players.youtube.prototype.onPlayerStateChange = function ( event ) {
+162 this.setPlayerState ( event.data ) ;
+163 } ;
+164
+165 /**
+166 * Called when the player quality changes.
+167 *
+168 * @param {string} newQuality The new quality for the change.
+169 */
+170 minplayer.players.youtube.prototype.onQualityChange = function ( newQuality ) {
+171 this.quality = newQuality ;
+172 } ;
+173
+174 /**
+175 * Determines if the player should show the playloader.
+176 *
+177 * @return {bool} If this player implements its own playLoader.
+178 */
+179 minplayer.players.youtube.prototype.hasPlayLoader = function ( ) {
+180 return true ;
+181 } ;
+182
+183 /**
+184 * @see minplayer.players.base#create
+185 * @return {object} The media player entity.
+186 */
+187 minplayer.players.youtube.prototype.create = function ( ) {
+188 minplayer.players.base.prototype.create.call ( this ) ;
+189
+190 // Insert the YouTube iframe API player.
+191 var tag = document.createElement ( 'script' ) ;
+192 tag.src = 'http://www.youtube.com/player_api?enablejsapi=1' ;
+193 var firstScriptTag = document.getElementsByTagName ( 'script' ) [ 0 ] ;
+194 firstScriptTag.parentNode.insertBefore ( tag , firstScriptTag ) ;
+195
+196 // Now register this player.
+197 this.register ( ) ;
+198
+199 // Create the iframe for this player.
+200 var iframe = document.createElement ( 'iframe' ) ;
+201 iframe.setAttribute ( 'id' , this.options.id + '-player' ) ;
+202 iframe.setAttribute ( 'type' , 'text/html' ) ;
+203 iframe.setAttribute ( 'width' , '100%' ) ;
+204 iframe.setAttribute ( 'height' , '100%' ) ;
+205 iframe.setAttribute ( 'frameborder' , '0' ) ;
+206
+207 // Get the source.
+208 var src = 'http://www.youtube.com/embed/' ;
+209 src + = this.mediaFile.id + '?' ;
+210
+211 // Determine the origin of this script.
+212 var origin = location.protocol ;
+213 origin + = '//' + location.hostname ;
+214 origin + = ( location.port && ':' + location.port ) ;
+215
+216 // Add the parameters to the src.
+217 src + = jQuery.param ( {
+218 'wmode' : 'opaque' ,
+219 'controls' : 0 ,
+220 'enablejsapi' : 1 ,
+221 'origin' : origin ,
+222 'autoplay' : this.options.autoplay ,
+223 'loop' : this.options.loop
+224 } ) ;
+225
+226 // Set the source of the iframe.
+227 iframe.setAttribute ( 'src' , src ) ;
+228
+229 // Return the player.
+230 return iframe ;
+231 } ;
+232
+233 /**
+234 * @see minplayer.players.base#load
+235 */
+236 minplayer.players.youtube.prototype.load = function ( file ) {
+237 minplayer.players.base.prototype.load.call ( this , file ) ;
+238 if ( file && this.isReady ( ) ) {
+239 this.player.loadVideoById ( file.id , 0 , this.quality ) ;
+240 }
+241 } ;
+242
+243 /**
+244 * @see minplayer.players.base#play
+245 */
+246 minplayer.players.youtube.prototype.play = function ( ) {
+247 minplayer.players.base.prototype.play.call ( this ) ;
+248 if ( this.isReady ( ) ) {
+249 this.player.playVideo ( ) ;
+250 }
+251 } ;
+252
+253 /**
+254 * @see minplayer.players.base#pause
+255 */
+256 minplayer.players.youtube.prototype.pause = function ( ) {
+257 minplayer.players.base.prototype.pause.call ( this ) ;
+258 if ( this.isReady ( ) ) {
+259 this.player.pauseVideo ( ) ;
+260 }
+261 } ;
+262
+263 /**
+264 * @see minplayer.players.base#stop
+265 */
+266 minplayer.players.youtube.prototype.stop = function ( ) {
+267 minplayer.players.base.prototype.stop.call ( this ) ;
+268 if ( this.isReady ( ) ) {
+269 this.player.stopVideo ( ) ;
+270 }
+271 } ;
+272
+273 /**
+274 * @see minplayer.players.base#seek
+275 */
+276 minplayer.players.youtube.prototype.seek = function ( pos ) {
+277 minplayer.players.base.prototype.seek.call ( this , pos ) ;
+278 if ( this.isReady ( ) ) {
+279 this.player.seekTo ( pos , true ) ;
+280 }
+281 } ;
+282
+283 /**
+284 * @see minplayer.players.base#setVolume
+285 */
+286 minplayer.players.youtube.prototype.setVolume = function ( vol ) {
+287 minplayer.players.base.prototype.setVolume.call ( this , vol ) ;
+288 if ( this.isReady ( ) ) {
+289 this.player.setVolume ( vol * 100 ) ;
+290 }
+291 } ;
+292
+293 /**
+294 * @see minplayer.players.base#getVolume
+295 */
+296 minplayer.players.youtube.prototype.getVolume = function ( callback ) {
+297 if ( this.isReady ( ) ) {
+298 callback ( this.player.getVolume ( ) ) ;
+299 }
+300 } ;
+301
+302 /**
+303 * @see minplayer.players.base#getDuration.
+304 */
+305 minplayer.players.youtube.prototype.getDuration = function ( callback ) {
+306 if ( this.isReady ( ) ) {
+307 callback ( this.player.getDuration ( ) ) ;
+308 }
+309 } ;
+310
+311 /**
+312 * @see minplayer.players.base#getCurrentTime
+313 */
+314 minplayer.players.youtube.prototype.getCurrentTime = function ( callback ) {
+315 if ( this.isReady ( ) ) {
+316 callback ( this.player.getCurrentTime ( ) ) ;
+317 }
+318 } ;
+319
+320 /**
+321 * @see minplayer.players.base#getBytesStart.
+322 */
+323 minplayer.players.youtube.prototype.getBytesStart = function ( callback ) {
+324 if ( this.isReady ( ) ) {
+325 callback ( this.player.getVideoStartBytes ( ) ) ;
+326 }
+327 } ;
+328
+329 /**
+330 * @see minplayer.players.base#getBytesLoaded.
+331 */
+332 minplayer.players.youtube.prototype.getBytesLoaded = function ( callback ) {
+333 if ( this.isReady ( ) ) {
+334 callback ( this.player.getVideoBytesLoaded ( ) ) ;
+335 }
+336 } ;
+337
+338 /**
+339 * @see minplayer.players.base#getBytesTotal.
+340 */
+341 minplayer.players.youtube.prototype.getBytesTotal = function ( callback ) {
+342 if ( this.isReady ( ) ) {
+343 callback ( this.player.getVideoBytesTotal ( ) ) ;
+344 }
+345 } ;
+346
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.plugin.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.plugin.js.html
new file mode 100644
index 0000000..269190b
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.plugin.js.html
@@ -0,0 +1,527 @@
+ 1 /** The minplayer namespace. */
+ 2 minplayer = minplayer || { } ;
+ 3
+ 4 /** Static array to keep track of all plugins. */
+ 5 minplayer.plugins = minplayer.plugins || { } ;
+ 6
+ 7 /** Static array to keep track of queues. */
+ 8 minplayer.queue = minplayer.queue || [ ] ;
+ 9
+ 10 /** Mutex lock to keep multiple triggers from occuring. */
+ 11 minplayer.lock = false ;
+ 12
+ 13 /**
+ 14 * @constructor
+ 15 * @class The base class for all plugins.
+ 16 *
+ 17 * @param {string} name The name of this plugin.
+ 18 * @param {object} context The jQuery context.
+ 19 * @param {object} options This components options.
+ 20 */
+ 21 minplayer.plugin = function ( name , context , options ) {
+ 22
+ 23 /** The name of this plugin. */
+ 24 this.name = name ;
+ 25
+ 26 /** The ready flag. */
+ 27 this.pluginReady = false ;
+ 28
+ 29 /** The options for this plugin. */
+ 30 this.options = options ;
+ 31
+ 32 /** The event queue. */
+ 33 this.queue = { } ;
+ 34
+ 35 /** Keep track of already triggered events. */
+ 36 this.triggered = { } ;
+ 37
+ 38 /** Create a queue lock. */
+ 39 this.lock = false ;
+ 40
+ 41 // Only call the constructor if we have a context.
+ 42 if ( context ) {
+ 43
+ 44 // Construct this plugin.
+ 45 this.construct ( ) ;
+ 46 }
+ 47 } ;
+ 48
+ 49 /**
+ 50 * The constructor which is called once the context is set.
+ 51 * Any class deriving from the plugin class should place all context
+ 52 * dependant functionality within this function instead of the standard
+ 53 * constructor function since it is called on object derivation as well
+ 54 * as object creation.
+ 55 */
+ 56 minplayer.plugin.prototype.construct = function ( ) {
+ 57
+ 58 // Adds this as a plugin.
+ 59 this.addPlugin ( ) ;
+ 60 } ;
+ 61
+ 62 /**
+ 63 * Destructor.
+ 64 */
+ 65 minplayer.plugin.prototype.destroy = function ( ) {
+ 66
+ 67 // Unbind all events.
+ 68 this.unbind ( ) ;
+ 69 } ;
+ 70
+ 71 /**
+ 72 * Loads all of the available plugins.
+ 73 */
+ 74 minplayer.plugin.prototype.loadPlugins = function ( ) {
+ 75
+ 76 // Get all the plugins to load.
+ 77 var instance = '' ;
+ 78
+ 79 // Iterate through all the plugins.
+ 80 for ( var name in this.options.plugins ) {
+ 81
+ 82 // Only load if it does not already exist.
+ 83 if ( ! minplayer.plugins [ this.options.id ] [ name ] ) {
+ 84
+ 85 // Get the instance name from the setting.
+ 86 instance = this.options.plugins [ name ] ;
+ 87
+ 88 // If this object exists.
+ 89 if ( minplayer [ name ] [ instance ] ) {
+ 90
+ 91 // Declare a new object.
+ 92 new minplayer [ name ] [ instance ] ( this.display , this.options ) ;
+ 93 }
+ 94 }
+ 95 }
+ 96 } ;
+ 97
+ 98 /**
+ 99 * Plugins should call this method when they are ready.
+100 */
+101 minplayer.plugin.prototype.ready = function ( ) {
+102
+103 // Keep this plugin from triggering multiple ready events.
+104 if ( ! this.pluginReady ) {
+105
+106 // Set the ready flag.
+107 this.pluginReady = true ;
+108
+109 // Now trigger that I am ready.
+110 this.trigger ( 'ready' ) ;
+111
+112 // Check the queue.
+113 this.checkQueue ( ) ;
+114 }
+115 } ;
+116
+117 /**
+118 * Adds a new plugin to this player.
+119 *
+120 * @param {string} name The name of this plugin.
+121 * @param {object} plugin A new plugin object, derived from media.plugin.
+122 */
+123 minplayer.plugin.prototype.addPlugin = function ( name , plugin ) {
+124 name = name || this.name ;
+125 plugin = plugin || this ;
+126
+127 // Make sure the plugin is valid.
+128 if ( plugin.isValid ( ) ) {
+129
+130 // If the plugins for this instance do not exist.
+131 if ( ! minplayer.plugins [ this.options.id ] ) {
+132
+133 // Initialize the plugins.
+134 minplayer.plugins [ this.options.id ] = { } ;
+135 }
+136
+137 // Add this plugin.
+138 minplayer.plugins [ this.options.id ] [ name ] = plugin ;
+139 }
+140 } ;
+141
+142 /**
+143 * Gets a plugin by name and calls callback when it is ready.
+144 *
+145 * @param {string} plugin The plugin of the plugin.
+146 * @param {function} callback Called when the plugin is ready.
+147 * @return {object} The plugin if no callback is provided.
+148 */
+149 minplayer.plugin.prototype.get = function ( plugin , callback ) {
+150
+151 // If they pass just a callback, then return all plugins when ready.
+152 if ( typeof plugin === 'function' ) {
+153 callback = plugin ;
+154 plugin = null ;
+155 }
+156
+157 // Return the minplayer.get equivalent.
+158 return minplayer.get.call ( this , this.options.id , plugin , callback ) ;
+159 } ;
+160
+161 /**
+162 * Check the queue and execute it.
+163 */
+164 minplayer.plugin.prototype.checkQueue = function ( ) {
+165
+166 // Initialize our variables.
+167 var q = null , i = 0 , check = false , newqueue = [ ] ;
+168
+169 // Set the lock.
+170 minplayer.lock = true ;
+171
+172 // Iterate through all the queues.
+173 var length = minplayer.queue.length ;
+174 for ( i = 0 ; i < length ; i ++ ) {
+175
+176 // Get the queue.
+177 q = minplayer.queue [ i ] ;
+178
+179 // Now check to see if this queue is about us.
+180 check = ! q.id && ! q.plugin ;
+181 check | = ( q.plugin == this.name ) && ( ! q.id || ( q.id == this.options.id ) ) ;
+182
+183 // If the check passes...
+184 if ( check ) {
+185 check = minplayer.bind.call (
+186 q.context ,
+187 q.event ,
+188 this.options.id ,
+189 this.name ,
+190 q.callback
+191 ) ;
+192 }
+193
+194 // Add the queue back if it doesn't check out.
+195 if ( ! check ) {
+196
+197 // Add this back to the queue.
+198 newqueue.push ( q ) ;
+199 }
+200 }
+201
+202 // Set the old queue to the new queue.
+203 minplayer.queue = newqueue ;
+204
+205 // Release the lock.
+206 minplayer.lock = false ;
+207 } ;
+208
+209 /**
+210 * Trigger a media event.
+211 *
+212 * @param {string} type The event type.
+213 * @param {object} data The event data object.
+214 * @return {object} The plugin object.
+215 */
+216 minplayer.plugin.prototype.trigger = function ( type , data ) {
+217 data = data || { } ;
+218 data.plugin = this ;
+219
+220 // Add this to our triggered array.
+221 this.triggered [ type ] = data ;
+222
+223 // Check to make sure the queue for this type exists.
+224 if ( this.queue [ type ] ) {
+225
+226 var i = 0 , queue = { } ;
+227
+228 // Iterate through all the callbacks in this queue.
+229 for ( i in this.queue [ type ] ) {
+230
+231 // Setup the event object, and call the callback.
+232 queue = this.queue [ type ] [ i ] ;
+233 queue.callback ( { target : this , data : queue.data } , data ) ;
+234 }
+235 }
+236
+237 // Return the plugin object.
+238 return this ;
+239 } ;
+240
+241 /**
+242 * Bind to a media event.
+243 *
+244 * @param {string} type The event type.
+245 * @param {object} data The data to bind with the event.
+246 * @param {function} fn The callback function.
+247 * @return {object} The plugin object.
+248 **/
+249 minplayer.plugin.prototype.bind = function ( type , data , fn ) {
+250
+251 // Allow the data to be the callback.
+252 if ( typeof data === 'function' ) {
+253 fn = data ;
+254 data = null ;
+255 }
+256
+257 // You must bind to a specific event and have a callback.
+258 if ( ! type || ! fn ) {
+259 return ;
+260 }
+261
+262 // Initialize the queue for this type.
+263 this.queue [ type ] = this.queue [ type ] || [ ] ;
+264
+265 // Unbind any existing equivalent events.
+266 this.unbind ( type , fn ) ;
+267
+268 // Now add this event to the queue.
+269 this.queue [ type ] . push ( {
+270 callback : fn ,
+271 data : data
+272 } ) ;
+273
+274 // Now see if this event has already been triggered.
+275 if ( this.triggered [ type ] ) {
+276
+277 // Go ahead and trigger the event.
+278 fn ( { target : this , data : data } , this.triggered [ type ] ) ;
+279 }
+280
+281 // Return the plugin.
+282 return this ;
+283 } ;
+284
+285 /**
+286 * Unbind a media event.
+287 *
+288 * @param {string} type The event type.
+289 * @param {function} fn The callback function.
+290 * @return {object} The plugin object.
+291 **/
+292 minplayer.plugin.prototype.unbind = function ( type , fn ) {
+293
+294 // If this is locked then try again after 10ms.
+295 if ( this.lock ) {
+296 var _this = this ;
+297 setTimeout ( function ( ) {
+298 _this.unbind ( type , fn ) ;
+299 } , 10 ) ;
+300 }
+301
+302 // Set the lock.
+303 this.lock = true ;
+304
+305 if ( ! type ) {
+306 this.queue = { } ;
+307 }
+308 else if ( ! fn ) {
+309 this.queue [ type ] = [ ] ;
+310 }
+311 else {
+312 // Iterate through all the callbacks and search for equal callbacks.
+313 var i = 0 , queue = { } ;
+314 for ( i in this.queue [ type ] ) {
+315 if ( this.queue [ type ] [ i ] . callback === fn ) {
+316 queue = this.queue [ type ] . splice ( 1 , 1 ) ;
+317 delete queue ;
+318 }
+319 }
+320 }
+321
+322 // Reset the lock.
+323 this.lock = false ;
+324
+325 // Return the plugin.
+326 return this ;
+327 } ;
+328
+329 /**
+330 * Adds an item to the queue.
+331 *
+332 * @param {object} context The context which this is called within.
+333 * @param {string} event The event to trigger on.
+334 * @param {string} id The player ID.
+335 * @param {string} plugin The name of the plugin.
+336 * @param {function} callback Called when the event occurs.
+337 */
+338 minplayer.addQueue = function ( context , event , id , plugin , callback ) {
+339
+340 // See if it is locked...
+341 if ( ! minplayer.lock ) {
+342 minplayer.queue.push ( {
+343 context : context ,
+344 id : id ,
+345 event : event ,
+346 plugin : plugin ,
+347 callback : callback
+348 } ) ;
+349 }
+350 else {
+351
+352 // If so, then try again after 10 milliseconds.
+353 setTimeout ( function ( ) {
+354 minplayer.addQueue ( context , id , event , plugin , callback ) ;
+355 } , 10 ) ;
+356 }
+357 } ;
+358
+359 /**
+360 * Binds an event to a plugin instance, and if it doesn't exist, then caches
+361 * it for a later time.
+362 *
+363 * @param {string} event The event to trigger on.
+364 * @param {string} id The player ID.
+365 * @param {string} plugin The name of the plugin.
+366 * @param {function} callback Called when the event occurs.
+367 * @return {boolean} If the bind was successful.
+368 * @this The object in context who called this method.
+369 */
+370 minplayer.bind = function ( event , id , plugin , callback ) {
+371
+372 // If no callback exists, then just return false.
+373 if ( ! callback ) {
+374 return false ;
+375 }
+376
+377 // Get the plugins.
+378 var inst = minplayer.plugins ;
+379
+380 // See if this plugin exists.
+381 if ( inst [ id ] [ plugin ] ) {
+382
+383 // If so, then bind the event to this plugin.
+384 inst [ id ] [ plugin ] . bind ( event , { context : this } , function ( event , data ) {
+385 callback.call ( event.data.context , data.plugin ) ;
+386 } ) ;
+387 return true ;
+388 }
+389
+390 // If not, then add it to the queue to bind later.
+391 minplayer.addQueue ( this , event , id , plugin , callback ) ;
+392
+393 // Return that this wasn't handled.
+394 return false ;
+395 } ;
+396
+397 /**
+398 * The main API for minPlayer.
+399 *
+400 * Provided that this function takes three parameters, there are 8 different
+401 * ways to use this api.
+402 *
+403 * id (0x100) - You want a specific player.
+404 * plugin (0x010) - You want a specific plugin.
+405 * callback (0x001) - You only want it when it is ready.
+406 *
+407 * 000 - You want all plugins from all players, ready or not.
+408 *
+409 * var plugins = minplayer.get();
+410 *
+411 * 001 - You want all plugins from all players, but only when ready.
+412 *
+413 * minplayer.get(function(plugin) {
+414 * // Code goes here.
+415 * });
+416 *
+417 * 010 - You want a specific plugin from all players, ready or not...
+418 *
+419 * var medias = minplayer.get(null, 'media');
+420 *
+421 * 011 - You want a specific plugin from all players, but only when ready.
+422 *
+423 * minplayer.get('player', function(player) {
+424 * // Code goes here.
+425 * });
+426 *
+427 * 100 - You want all plugins from a specific player, ready or not.
+428 *
+429 * var plugins = minplayer.get('player_id');
+430 *
+431 * 101 - You want all plugins from a specific player, but only when ready.
+432 *
+433 * minplayer.get('player_id', null, function(plugin) {
+434 * // Code goes here.
+435 * });
+436 *
+437 * 110 - You want a specific plugin from a specific player, ready or not.
+438 *
+439 * var plugin = minplayer.get('player_id', 'media');
+440 *
+441 * 111 - You want a specific plugin from a specific player, only when ready.
+442 *
+443 * minplayer.get('player_id', 'media', function(media) {
+444 * // Code goes here.
+445 * });
+446 *
+447 * @this The context in which this function was called.
+448 * @param {string} id The ID of the widget to get the plugins from.
+449 * @param {string} plugin The name of the plugin.
+450 * @param {function} callback Called when the plugin is ready.
+451 * @return {object} The plugin object if it is immediately available.
+452 */
+453 minplayer.get = function ( id , plugin , callback ) {
+454
+455 // Normalize the arguments for a better interface.
+456 if ( typeof id === 'function' ) {
+457 callback = id ;
+458 plugin = id = null ;
+459 }
+460
+461 if ( typeof plugin === 'function' ) {
+462 callback = plugin ;
+463 plugin = id ;
+464 id = null ;
+465 }
+466
+467 // Make sure the callback is a callback.
+468 callback = ( typeof callback === 'function' ) ? callback : null ;
+469
+470 // Get the plugins.
+471 var plugins = minplayer.plugins ;
+472
+473 // 0x000
+474 if ( ! id && ! plugin && ! callback ) {
+475 return plugins ;
+476 }
+477 // 0x100
+478 else if ( id && ! plugin && ! callback ) {
+479 return plugins [ id ] ;
+480 }
+481 // 0x110
+482 else if ( id && plugin && ! callback ) {
+483 return plugins [ id ] [ plugin ] ;
+484 }
+485 // 0x111
+486 else if ( id && plugin && callback ) {
+487 minplayer.bind.call ( this , 'ready' , id , plugin , callback ) ;
+488 }
+489 // 0x011
+490 else if ( ! id && plugin && callback ) {
+491 for ( var id in plugins ) {
+492 minplayer.bind.call ( this , 'ready' , id , plugin , callback ) ;
+493 }
+494 }
+495 // 0x101
+496 else if ( id && ! plugin && callback ) {
+497 for ( var plugin in plugins [ id ] ) {
+498 minplayer.bind.call ( this , 'ready' , id , plugin , callback ) ;
+499 }
+500 }
+501 // 0x010
+502 else if ( ! id && plugin && ! callback ) {
+503 var plugin_types = { } ;
+504 for ( var id in plugins ) {
+505 if ( plugins.hasOwnProperty ( id ) && plugins [ id ] . hasOwnProperty ( plugin ) ) {
+506 plugin_types [ id ] = plugins [ id ] [ plugin ] ;
+507 }
+508 }
+509 return plugin_types ;
+510 }
+511 // 0x001
+512 else {
+513 for ( var id in plugins ) {
+514 for ( var plugin in plugins [ id ] ) {
+515 minplayer.bind.call ( this , 'ready' , id , plugin , callback ) ;
+516 }
+517 }
+518 }
+519 } ;
+520
\ No newline at end of file
diff --git a/core/modules/file/player/doc/symbols/src/src_minplayer.templates.base.js.html b/core/modules/file/player/doc/symbols/src/src_minplayer.templates.base.js.html
new file mode 100644
index 0000000..e4bdb5c
--- /dev/null
+++ b/core/modules/file/player/doc/symbols/src/src_minplayer.templates.base.js.html
@@ -0,0 +1,66 @@
+ 1 /** The minplayer namespace. */
+ 2 var minplayer = minplayer || { } ;
+ 3
+ 4 /** All of the template implementations */
+ 5 minplayer.templates = minplayer.templates || { } ;
+ 6
+ 7 /**
+ 8 * @constructor
+ 9 * @extends minplayer.display
+ 10 * @class The base template class which all templates should derive.
+ 11 *
+ 12 * @param {object} context The jQuery context.
+ 13 * @param {object} options This components options.
+ 14 */
+ 15 minplayer.templates.base = function ( context , options ) {
+ 16
+ 17 // Derive from display
+ 18 minplayer.display.call ( this , 'template' , context , options ) ;
+ 19 } ;
+ 20
+ 21 /** Derive from minplayer.display. */
+ 22 minplayer.templates.base.prototype = new minplayer.display ( ) ;
+ 23
+ 24 /** Reset the constructor. */
+ 25 minplayer.templates.base.prototype.constructor = minplayer.templates.base ;
+ 26
+ 27 /**
+ 28 * @see minplayer.plugin#construct
+ 29 */
+ 30 minplayer.templates.base.prototype.construct = function ( ) {
+ 31
+ 32 // Call the minplayer display constructor.
+ 33 minplayer.display.prototype.construct.call ( this ) ;
+ 34
+ 35 // We are now ready.
+ 36 this.ready ( ) ;
+ 37 } ;
+ 38
+ 39 /**
+ 40 * @see minplayer.display#getElements
+ 41 * @return {object} The display elemnents for this component.
+ 42 */
+ 43 minplayer.templates.base.prototype.getElements = function ( ) {
+ 44 var elements = minplayer.display.prototype.getElements.call ( this ) ;
+ 45 return jQuery.extend ( elements , {
+ 46 player : null ,
+ 47 display : null ,
+ 48 media : null
+ 49 } ) ;
+ 50 } ;
+ 51
+ 52 /**
+ 53 * Called when the media player goes into full screen mode.
+ 54 *
+ 55 * @param {boolean} full TRUE - The player is in fullscreen, FALSE otherwise.
+ 56 */
+ 57 minplayer.templates.base.prototype.onFullScreen = function ( full ) {
+ 58 } ;
+ 59
\ No newline at end of file
diff --git a/core/modules/file/player/flash/README.txt b/core/modules/file/player/flash/README.txt
new file mode 100755
index 0000000..944acc3
--- /dev/null
+++ b/core/modules/file/player/flash/README.txt
@@ -0,0 +1,12 @@
+The minplayer is a GPLv3, minimalistic, skinable, plugin based Flash media player.
+
+In addition to being a minimal Flash player, it was built with a solid API so that any
+JavaScript widget can communicate to this player easily and effectively controlling it
+from outside sources.
+
+This player was written with several objectives.
+
+ - Small and lightweight
+ - Solid plugin based system to easily build on top of this player without recompiling.
+ - Complete JavaScript API.
+ - Configurable using external XML files.
\ No newline at end of file
diff --git a/core/modules/file/player/flash/config/config.xml b/core/modules/file/player/flash/config/config.xml
new file mode 100644
index 0000000..8192ae4
--- /dev/null
+++ b/core/modules/file/player/flash/config/config.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+ com.mediafront.display.media.MediaPlayer
+
+
+ skins/%skin/mediaPlayer.swf
+ mediaPlayer
+ mediaPlayer
+ true
+
+
+ com.mediafront.display.media.controls.PlayLoader
+ skins/%skin/playLoader.swf
+ playLoader
+ playLoader
+ true
+
+ mediaPlayer
+
+
+
+ com.mediafront.display.media.controls.ControlBar
+ skins/%skin/controlBar.swf
+ controlBar
+ controlBar
+ true
+
+ mediaPlayer
+
+
+
+
diff --git a/core/modules/file/player/flash/config/nocontrols.xml b/core/modules/file/player/flash/config/nocontrols.xml
new file mode 100644
index 0000000..28fef65
--- /dev/null
+++ b/core/modules/file/player/flash/config/nocontrols.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+ com.mediafront.display.media.MediaPlayer
+
+
+ skins/%skin/mediaPlayer.swf
+ mediaPlayer
+ mediaPlayer
+ true
+
+
+ com.mediafront.display.media.controls.PlayLoader
+ skins/%skin/playLoader.swf
+ playLoader
+ playLoader
+ false
+
+ mediaPlayer
+
+
+
+ com.mediafront.display.media.controls.ControlBar
+ skins/%skin/controlBar.swf
+ controlBar
+ controlBar
+ false
+
+ mediaPlayer
+
+
+
+
\ No newline at end of file
diff --git a/core/modules/file/player/flash/minplayer.swf b/core/modules/file/player/flash/minplayer.swf
new file mode 100644
index 0000000..3d27d51
Binary files /dev/null and b/core/modules/file/player/flash/minplayer.swf differ
diff --git a/core/modules/file/player/flash/skins/default/controlBar.swf b/core/modules/file/player/flash/skins/default/controlBar.swf
new file mode 100644
index 0000000..95e2653
Binary files /dev/null and b/core/modules/file/player/flash/skins/default/controlBar.swf differ
diff --git a/core/modules/file/player/flash/skins/default/mediaPlayer.swf b/core/modules/file/player/flash/skins/default/mediaPlayer.swf
new file mode 100644
index 0000000..9c16153
Binary files /dev/null and b/core/modules/file/player/flash/skins/default/mediaPlayer.swf differ
diff --git a/core/modules/file/player/flash/skins/default/playLoader.swf b/core/modules/file/player/flash/skins/default/playLoader.swf
new file mode 100644
index 0000000..521c405
Binary files /dev/null and b/core/modules/file/player/flash/skins/default/playLoader.swf differ
diff --git a/core/modules/file/player/index.html b/core/modules/file/player/index.html
new file mode 100644
index 0000000..b00b10d
--- /dev/null
+++ b/core/modules/file/player/index.html
@@ -0,0 +1,63 @@
+
+
+
+ minPlayer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ minPlayer
+ Below are some examples of the minPlayer in action. It is creating a common API to interact with all different types of players, including Vimeo and YouTube.
+ h264 Example
+
+
+
+ YouTube Example
+
+
+
+ Two YouTube Players on same page
+
+
+
+ Vimeo Example
+
+
+
+
+
diff --git a/core/modules/file/player/makefile b/core/modules/file/player/makefile
new file mode 100644
index 0000000..7d69766
--- /dev/null
+++ b/core/modules/file/player/makefile
@@ -0,0 +1,67 @@
+# To run this makefile, you must do the following.
+#
+# 1.) Download http://closure-compiler.googlecode.com/files/compiler-latest.zip
+# and place compiler.jar within the tools directory.
+#
+# 2.) Install closure-linter tool at by following
+# http://code.google.com/closure/utilities/docs/linter_howto.html
+#
+# 3.) Download the JSDoc toolkit found at
+# http://code.google.com/p/jsdoc-toolkit and place the jsdoc-toolkit
+# directory within the tools directory.
+
+# Create the list of files
+files = src/minplayer.compatibility.js\
+ src/minplayer.async.js\
+ src/minplayer.flags.js\
+ src/minplayer.plugin.js\
+ src/minplayer.display.js\
+ src/minplayer.js\
+ src/minplayer.image.js\
+ src/minplayer.file.js\
+ src/minplayer.playLoader.base.js\
+ src/minplayer.players.base.js\
+ src/minplayer.players.html5.js\
+ src/minplayer.players.flash.js\
+ src/minplayer.players.minplayer.js\
+ src/minplayer.players.youtube.js\
+ src/minplayer.players.vimeo.js\
+ src/minplayer.controller.base.js
+
+.DEFAULT_GOAL := all
+
+all: jslint js jsdoc
+
+# Perform a jsLint on all the files.
+jslint: ${files}
+ gjslint $^
+
+# Create an aggregated js file and a compressed js file.
+js: ${files}
+ @echo "Generating aggregated bin/minplayer.js file"
+ @cat > bin/minplayer.js $^
+ @echo "Generating compressed bin/minplayer.compressed file"
+ @java -jar tools/compiler.jar --js bin/minplayer.js --js_output_file bin/minplayer.compressed.js
+
+# Create the documentation from source code.
+jsdoc: ${files}
+ @echo "Generating documetation."
+ @java -jar tools/jsdoc-toolkit/jsrun.jar tools/jsdoc-toolkit/app/run.js -a -t=tools/jsdoc-toolkit/templates/jsdoc -d=doc $^
+
+# Fix the js style on all the files.
+fixjsstyle: ${files}
+ fixjsstyle $^
+
+# Install the necessary tools.
+tools:
+ apt-get install python-setuptools
+ apt-get install unzip
+ wget http://closure-compiler.googlecode.com/files/compiler-latest.zip -P tools
+ unzip tools/compiler-latest.zip -d tools
+ rm tools/compiler-latest.zip tools/COPYING tools/README
+ easy_install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz
+ wget http://jsdoc-toolkit.googlecode.com/files/jsdoc_toolkit-2.4.0.zip -P tools
+ unzip tools/jsdoc_toolkit-2.4.0.zip -d tools
+ mv tools/jsdoc_toolkit-2.4.0/jsdoc-toolkit tools/jsdoc-toolkit
+ rm -rd tools/jsdoc_toolkit-2.4.0
+ rm tools/jsdoc_toolkit-2.4.0.zip
diff --git a/core/modules/file/player/src/minplayer.async.js b/core/modules/file/player/src/minplayer.async.js
new file mode 100644
index 0000000..656aa11
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.async.js
@@ -0,0 +1,61 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/**
+ * @constructor
+ * @class This class keeps track of asynchronous get requests for certain
+ * variables within the player.
+ */
+minplayer.async = function() {
+
+ /** The final value of this asynchronous variable. */
+ this.value = null;
+
+ /** The queue of callbacks to call when this value is determined. */
+ this.queue = [];
+};
+
+/**
+ * Retrieve the value of this variable.
+ *
+ * @param {function} callback The function to call when the value is determined.
+ * @param {function} pollValue The poll function to try and get the value every
+ * 1 second if the value is not set.
+ */
+minplayer.async.prototype.get = function(callback, pollValue) {
+
+ // If the value is set, then immediately call the callback, otherwise, just
+ // add it to the queue when the variable is set.
+ if (this.value !== null) {
+ callback(this.value);
+ }
+ else {
+
+ // Add this callback to the queue.
+ this.queue.push(callback);
+ }
+};
+
+/**
+ * Sets the value of an asynchronous value.
+ *
+ * @param {void} val The value to set.
+ */
+minplayer.async.prototype.set = function(val) {
+
+ // Set the value.
+ this.value = val;
+
+ // Get the callback queue length.
+ var i = this.queue.length;
+
+ // Iterate through all the callbacks and call them.
+ if (i) {
+ while (i--) {
+ this.queue[i](val);
+ }
+
+ // Reset the queue.
+ this.queue = [];
+ }
+};
diff --git a/core/modules/file/player/src/minplayer.compatibility.js b/core/modules/file/player/src/minplayer.compatibility.js
new file mode 100644
index 0000000..0a0dbf7
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.compatibility.js
@@ -0,0 +1,101 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+// Private function to check a single element's play type.
+function checkPlayType(elem, playType) {
+ if ((typeof elem.canPlayType) === 'function') {
+ if (typeof playType === 'object') {
+ var i = playType.length;
+ var mimetype = '';
+ while (i--) {
+ mimetype = checkPlayType(elem, playType[i]);
+ if (!!mimetype) {
+ break;
+ }
+ }
+ return mimetype;
+ }
+ else {
+ var canPlay = elem.canPlayType(playType);
+ if (('no' !== canPlay) && ('' !== canPlay)) {
+ return playType;
+ }
+ }
+ }
+ return '';
+}
+
+/**
+ * @constructor
+ * @class This class is used to define the types of media that can be played
+ * within the browser.
+ *
+ * Usage:
+ *
+ * var playTypes = new minplayer.compatibility();
+ *
+ * if (playTypes.videoOGG) {
+ * console.log("This browser can play OGG video");
+ * }
+ *
+ * if (playTypes.videoH264) {
+ * console.log("This browser can play H264 video");
+ * }
+ *
+ * if (playTypes.videoWEBM) {
+ * console.log("This browser can play WebM video");
+ * }
+ *
+ * if (playTypes.audioOGG) {
+ * console.log("This browser can play OGG audio");
+ * }
+ *
+ * if (playTypes.audioMP3) {
+ * console.log("This browser can play MP3 audio");
+ * }
+ *
+ * if (playTypes.audioMP4) {
+ * console.log("This browser can play MP4 audio");
+ * }
+ *
+ */
+minplayer.compatibility = function() {
+ var elem = null;
+
+ // Create a video element.
+ elem = document.createElement('video');
+
+ /** Can play OGG video */
+ this.videoOGG = checkPlayType(elem, 'video/ogg');
+
+ /** Can play H264 video */
+ this.videoH264 = checkPlayType(elem, [
+ 'video/mp4',
+ 'video/h264'
+ ]);
+
+ /** Can play WEBM video */
+ this.videoWEBM = checkPlayType(elem, [
+ 'video/x-webm',
+ 'video/webm',
+ 'application/octet-stream'
+ ]);
+
+ // Create an audio element.
+ elem = document.createElement('audio');
+
+ /** Can play audio OGG */
+ this.audioOGG = checkPlayType(elem, 'audio/ogg');
+
+ /** Can play audio MP3 */
+ this.audioMP3 = checkPlayType(elem, 'audio/mpeg');
+
+ /** Can play audio MP4 */
+ this.audioMP4 = checkPlayType(elem, 'audio/mp4');
+};
+
+if (!minplayer.playTypes) {
+
+ /** The compatible playtypes for this browser. */
+ minplayer.playTypes = new minplayer.compatibility();
+}
diff --git a/core/modules/file/player/src/minplayer.controller.base.js b/core/modules/file/player/src/minplayer.controller.base.js
new file mode 100644
index 0000000..9440954
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.controller.base.js
@@ -0,0 +1,295 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** Define the controller object. */
+minplayer.controller = minplayer.controller || {};
+
+/**
+ * @constructor
+ * @extends minplayer.display
+ * @class This is the base minplayer controller. Other controllers can derive
+ * from the base and either build on top of it or simply define the elements
+ * that this base controller uses.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.controller.base = function(context, options) {
+
+ // Derive from display
+ minplayer.display.call(this, 'controller', context, options);
+};
+
+// Define the prototype for all controllers.
+var controllersBase = minplayer.controller.base;
+
+/** Derive from minplayer.display. */
+minplayer.controller.base.prototype = new minplayer.display();
+
+/** Reset the constructor. */
+minplayer.controller.base.prototype.constructor = minplayer.controller.base;
+
+/**
+ * A static function that will format a time value into a string time format.
+ *
+ * @param {integer} time An integer value of time.
+ * @return {string} A string representation of the time.
+ */
+minplayer.formatTime = function(time) {
+ time = time || 0;
+ var seconds = 0, minutes = 0, hour = 0, timeString = '';
+
+ hour = Math.floor(time / 3600);
+ time -= (hour * 3600);
+ minutes = Math.floor(time / 60);
+ time -= (minutes * 60);
+ seconds = Math.floor(time % 60);
+
+ if (hour) {
+ timeString += String(hour);
+ timeString += ':';
+ }
+
+ timeString += (minutes >= 10) ? String(minutes) : ('0' + String(minutes));
+ timeString += ':';
+ timeString += (seconds >= 10) ? String(seconds) : ('0' + String(seconds));
+ return {time: timeString, units: ''};
+};
+
+/**
+ * @see minplayer.display#getElements
+ * @return {object} The elements defined by this display.
+ */
+minplayer.controller.base.prototype.getElements = function() {
+ var elements = minplayer.display.prototype.getElements.call(this);
+ return jQuery.extend(elements, {
+ play: null,
+ pause: null,
+ fullscreen: null,
+ seek: null,
+ progress: null,
+ volume: null,
+ timer: null
+ });
+};
+
+/**
+ * @see minplayer.plugin#construct
+ */
+minplayer.controller.base.prototype.construct = function() {
+
+ // Call the minplayer plugin constructor.
+ minplayer.display.prototype.construct.call(this);
+
+ // If they have a fullscreen button.
+ if (this.elements.fullscreen) {
+
+ // Bind to the click event.
+ this.elements.fullscreen.bind('click', {obj: this}, function(event) {
+ var isFull = event.data.obj.elements.player.hasClass('fullscreen');
+ if (isFull) {
+ event.data.obj.elements.player.removeClass('fullscreen');
+ }
+ else {
+ event.data.obj.elements.player.addClass('fullscreen');
+ }
+ event.data.obj.trigger('fullscreen', !isFull);
+ }).css({'pointer' : 'hand'});
+ }
+
+ // Keep track of if we are dragging...
+ this.dragging = false;
+
+ // If they have a seek bar.
+ if (this.elements.seek) {
+
+ // Create the seek bar slider control.
+ this.seekBar = this.elements.seek.slider({
+ range: 'min'
+ });
+ }
+
+ // If they have a volume bar.
+ if (this.elements.volume) {
+
+ // Create the volume bar slider control.
+ this.volumeBar = this.elements.volume.slider({
+ range: 'min',
+ orientation: 'vertical'
+ });
+ }
+
+ // Get the media plugin.
+ this.get('media', function(media) {
+
+ var _this = this;
+
+ // If they have a pause button
+ if (this.elements.pause) {
+
+ // Bind to the click on this button.
+ this.elements.pause.unbind().bind('click', {obj: this}, function(event) {
+ event.preventDefault();
+ event.data.obj.playPause(false, media);
+ });
+
+ // Bind to the pause event of the media.
+ media.bind('pause', {obj: this}, function(event) {
+ event.data.obj.setPlayPause(true);
+ });
+ }
+
+ // If they have a play button
+ if (this.elements.play) {
+
+ // Bind to the click on this button.
+ this.elements.play.unbind().bind('click', {obj: this}, function(event) {
+ event.preventDefault();
+ event.data.obj.playPause(true, media);
+ });
+
+ // Bind to the play event of the media.
+ media.bind('playing', {obj: this}, function(event) {
+ event.data.obj.setPlayPause(false);
+ });
+ }
+
+ // If they have a duration, then trigger on duration change.
+ if (this.elements.duration) {
+
+ // Bind to the duration change event.
+ media.bind('durationchange', {obj: this}, function(event, data) {
+ event.data.obj.setTimeString('duration', data.duration);
+ });
+
+ // Set the timestring to the duration.
+ media.getDuration(function(duration) {
+ _this.setTimeString('duration', duration);
+ });
+ }
+
+ // If they have a progress element.
+ if (this.elements.progress) {
+
+ // Bind to the progress event.
+ media.bind('progress', {obj: this}, function(event, data) {
+ var percent = data.total ? (data.loaded / data.total) * 100 : 0;
+ event.data.obj.elements.progress.width(percent + '%');
+ });
+ }
+
+ // If they have a seek bar or timer, bind to the timeupdate.
+ if (this.seekBar || this.elements.timer) {
+
+ // Bind to the time update event.
+ media.bind('timeupdate', {obj: this}, function(event, data) {
+ if (!event.data.obj.dragging) {
+ var value = 0;
+ if (data.duration) {
+ value = (data.currentTime / data.duration) * 100;
+ }
+
+ // Update the seek bar if it exists.
+ if (event.data.obj.seekBar) {
+ event.data.obj.seekBar.slider('option', 'value', value);
+ }
+
+ event.data.obj.setTimeString('timer', data.currentTime);
+ }
+ });
+ }
+
+ // If they have a seekBar element.
+ if (this.seekBar) {
+
+ // Register the events for the control bar to control the media.
+ this.seekBar.slider({
+ start: function(event, ui) {
+ _this.dragging = true;
+ },
+ stop: function(event, ui) {
+ _this.dragging = false;
+ media.getDuration(function(duration) {
+ media.seek((ui.value / 100) * duration);
+ });
+ },
+ slide: function(event, ui) {
+ media.getDuration(function(duration) {
+ var time = (ui.value / 100) * duration;
+ if (!_this.dragging) {
+ media.seek(time);
+ }
+ _this.setTimeString('timer', time);
+ });
+ }
+ });
+ }
+
+ // Setup the volume bar.
+ if (this.volumeBar) {
+
+ // Create the slider.
+ this.volumeBar.slider({
+ slide: function(event, ui) {
+ media.setVolume(ui.value / 100);
+ }
+ });
+
+ media.bind('volumeupdate', {obj: this}, function(event, vol) {
+ event.data.obj.volumeBar.slider('option', 'value', (vol * 100));
+ });
+
+ // Set the volume to match that of the player.
+ media.getVolume(function(vol) {
+ _this.volumeBar.slider('option', 'value', (vol * 100));
+ });
+ }
+ });
+
+ // We are now ready.
+ this.ready();
+};
+
+/**
+ * Sets the play and pause state of the control bar.
+ *
+ * @param {boolean} state TRUE - Show Play, FALSE - Show Pause.
+ */
+minplayer.controller.base.prototype.setPlayPause = function(state) {
+ var css = '';
+ if (this.elements.play) {
+ css = state ? 'inherit' : 'none';
+ this.elements.play.css('display', css);
+ }
+ if (this.elements.pause) {
+ css = state ? 'none' : 'inherit';
+ this.elements.pause.css('display', css);
+ }
+};
+
+/**
+ * Plays or pauses the media.
+ *
+ * @param {bool} state true => play, false => pause.
+ * @param {object} media The media player object.
+ */
+minplayer.controller.base.prototype.playPause = function(state, media) {
+ var type = state ? 'play' : 'pause';
+ this.display.trigger(type);
+ this.setPlayPause(!state);
+ if (media) {
+ media[type]();
+ }
+};
+
+/**
+ * Sets the time string on the control bar.
+ *
+ * @param {string} element The name of the element to set.
+ * @param {number} time The total time amount to set.
+ */
+minplayer.controller.base.prototype.setTimeString = function(element, time) {
+ if (this.elements[element]) {
+ this.elements[element].text(minplayer.formatTime(time).time);
+ }
+};
diff --git a/core/modules/file/player/src/minplayer.display.js b/core/modules/file/player/src/minplayer.display.js
new file mode 100644
index 0000000..57b0c81
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.display.js
@@ -0,0 +1,128 @@
+/** The minplayer namespace. */
+minplayer = minplayer || {};
+
+/**
+ * @constructor
+ * @extends minplayer.plugin
+ * @class Base class used to provide the display and options for any component
+ * deriving from this class. Components who derive are expected to provide
+ * the elements that they define by implementing the getElements method.
+ *
+ * @param {string} name The name of this plugin.
+ * @param {object} context The jQuery context this component resides.
+ * @param {object} options The options for this component.
+ */
+minplayer.display = function(name, context, options) {
+
+ // See if we allow resize on this display.
+ this.allowResize = false;
+
+ if (context) {
+
+ // Set the display.
+ this.display = this.getDisplay(context, options);
+ }
+
+ // Derive from plugin
+ minplayer.plugin.call(this, name, context, options);
+};
+
+/** Derive from minplayer.plugin. */
+minplayer.display.prototype = new minplayer.plugin();
+
+/** Reset the constructor. */
+minplayer.display.prototype.constructor = minplayer.display;
+
+/**
+ * Returns the display for this component.
+ *
+ * @param {object} context The original context.
+ * @param {object} options The options for this component.
+ * @return {object} The jQuery context for this display.
+ */
+minplayer.display.prototype.getDisplay = function(context, options) {
+ return jQuery(context);
+};
+
+/**
+ * @see minplayer.plugin.construct
+ */
+minplayer.display.prototype.construct = function() {
+
+ // Call the plugin constructor.
+ minplayer.plugin.prototype.construct.call(this);
+
+ // Extend all display elements.
+ this.options.elements = this.options.elements || {};
+ jQuery.extend(this.options.elements, this.getElements());
+ this.elements = this.options.elements;
+
+ // Only do this if they allow resize for this display.
+ if (this.allowResize) {
+
+ // Set the resize timeout and this pointer.
+ var resizeTimeout = 0;
+ var _this = this;
+
+ // Add a handler to trigger a resize event.
+ jQuery(window).resize(function() {
+ clearTimeout(resizeTimeout);
+ resizeTimeout = setTimeout(function() {
+ _this.onResize();
+ }, 200);
+ });
+ }
+};
+
+/**
+ * Called when the window resizes.
+ */
+minplayer.display.prototype.onResize = function() {
+};
+
+/**
+ * Returns a scaled rectangle provided a ratio and the container rect.
+ *
+ * @param {number} ratio The width/height ratio of what is being scaled.
+ * @param {object} rect The bounding rectangle for scaling.
+ * @return {object} The Rectangle object of the scaled rectangle.
+ */
+minplayer.display.prototype.getScaledRect = function(ratio, rect) {
+ var scaledRect = {};
+ scaledRect.x = rect.x ? rect.x : 0;
+ scaledRect.y = rect.y ? rect.y : 0;
+ scaledRect.width = rect.width ? rect.width : 0;
+ scaledRect.height = rect.height ? rect.height : 0;
+ if (ratio) {
+ if ((rect.width / rect.height) > ratio) {
+ scaledRect.height = rect.height;
+ scaledRect.width = Math.floor(rect.height * ratio);
+ }
+ else {
+ scaledRect.height = Math.floor(rect.width / ratio);
+ scaledRect.width = rect.width;
+ }
+ scaledRect.x = Math.floor((rect.width - scaledRect.width) / 2);
+ scaledRect.y = Math.floor((rect.height - scaledRect.height) / 2);
+ }
+ return scaledRect;
+};
+
+/**
+ * Returns all the jQuery elements that this component uses.
+ *
+ * @return {object} An object which defines all the jQuery elements that
+ * this component uses.
+ */
+minplayer.display.prototype.getElements = function() {
+ return {};
+};
+
+/**
+ * Returns if this component is valid and exists within the DOM.
+ *
+ * @return {boolean} TRUE if the plugin display is valid.
+ */
+minplayer.display.prototype.isValid = function() {
+ return (this.display.length > 0);
+};
diff --git a/core/modules/file/player/src/minplayer.file.js b/core/modules/file/player/src/minplayer.file.js
new file mode 100644
index 0000000..a0b7fa2
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.file.js
@@ -0,0 +1,165 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/**
+ * @constructor
+ * @class A wrapper class used to provide all the data necessary to control an
+ * individual file within this media player.
+ *
+ * @param {object} file A media file object with minimal required information.
+ */
+minplayer.file = function(file) {
+ this.duration = file.duration || 0;
+ this.bytesTotal = file.bytesTotal || 0;
+ this.quality = file.quality || 0;
+ this.stream = file.stream || '';
+ this.path = file.path || '';
+ this.codecs = file.codecs || '';
+
+ // These should be provided, but just in case...
+ this.extension = file.extension || this.getFileExtension();
+ this.mimetype = file.mimetype || file.filemime || this.getMimeType();
+ this.type = file.type || this.getType();
+
+ // Fail safe to try and guess the mimetype and media type.
+ if (!this.type) {
+ this.mimetype = this.getMimeType();
+ this.type = this.getType();
+ }
+
+ // Get the player.
+ this.player = file.player || this.getBestPlayer();
+ this.priority = file.priority || this.getPriority();
+ this.id = file.id || this.getId();
+};
+
+/**
+ * Returns the best player for the job.
+ *
+ * @return {string} The best player to play the media file.
+ */
+minplayer.file.prototype.getBestPlayer = function() {
+ var bestplayer = null, bestpriority = 0, _this = this;
+ jQuery.each(minplayer.players, function(name, player) {
+ var priority = player.getPriority();
+ if (player.canPlay(_this) && (priority > bestpriority)) {
+ bestplayer = name;
+ bestpriority = priority;
+ }
+ });
+ return bestplayer;
+};
+
+/**
+ * The priority of this file is determined by the priority of the best
+ * player multiplied by the priority of the mimetype.
+ *
+ * @return {integer} The priority of the media file.
+ */
+minplayer.file.prototype.getPriority = function() {
+ var priority = 1;
+ if (this.player) {
+ priority = minplayer.players[this.player].getPriority();
+ }
+ switch (this.mimetype) {
+ case 'video/x-webm':
+ case 'video/webm':
+ case 'application/octet-stream':
+ return priority * 10;
+ case 'video/mp4':
+ case 'audio/mp4':
+ case 'audio/mpeg':
+ return priority * 9;
+ case 'video/ogg':
+ case 'audio/ogg':
+ case 'video/quicktime':
+ return priority * 8;
+ default:
+ return priority * 5;
+ }
+};
+
+/**
+ * Returns the file extension of the file path.
+ *
+ * @return {string} The file extension.
+ */
+minplayer.file.prototype.getFileExtension = function() {
+ return this.path.substring(this.path.lastIndexOf('.') + 1).toLowerCase();
+};
+
+/**
+ * Returns the proper mimetype based off of the extension.
+ *
+ * @return {string} The mimetype of the file based off of extension.
+ */
+minplayer.file.prototype.getMimeType = function() {
+ switch (this.extension) {
+ case 'mp4': case 'm4v': case 'flv': case 'f4v':
+ return 'video/mp4';
+ case'webm':
+ return 'video/webm';
+ case 'ogg': case 'ogv':
+ return 'video/ogg';
+ case '3g2':
+ return 'video/3gpp2';
+ case '3gpp':
+ case '3gp':
+ return 'video/3gpp';
+ case 'mov':
+ return 'video/quicktime';
+ case'swf':
+ return 'application/x-shockwave-flash';
+ case 'oga':
+ return 'audio/ogg';
+ case 'mp3':
+ return 'audio/mpeg';
+ case 'm4a': case 'f4a':
+ return 'audio/mp4';
+ case 'aac':
+ return 'audio/aac';
+ case 'wav':
+ return 'audio/vnd.wave';
+ case 'wma':
+ return 'audio/x-ms-wma';
+ default:
+ return 'unknown';
+ }
+};
+
+/**
+ * The type of media this is: video or audio.
+ *
+ * @return {string} "video" or "audio" based on what the type of media this
+ * is.
+ */
+minplayer.file.prototype.getType = function() {
+ switch (this.mimetype) {
+ case 'video/mp4':
+ case 'video/webm':
+ case 'application/octet-stream':
+ case 'video/x-webm':
+ case 'video/ogg':
+ case 'video/3gpp2':
+ case 'video/3gpp':
+ case 'video/quicktime':
+ return 'video';
+ case 'audio/mp3':
+ case 'audio/mp4':
+ case 'audio/ogg':
+ case 'audio/mpeg':
+ return 'audio';
+ default:
+ return '';
+ }
+};
+
+/**
+ * Returns the ID for this media file.
+ *
+ * @return {string} The id for this media file which is provided by the player.
+ */
+minplayer.file.prototype.getId = function() {
+ var player = minplayer.players[this.player];
+ return (player && player.getMediaId) ? player.getMediaId(this) : '';
+};
diff --git a/core/modules/file/player/src/minplayer.flags.js b/core/modules/file/player/src/minplayer.flags.js
new file mode 100644
index 0000000..4d97c37
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.flags.js
@@ -0,0 +1,71 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/**
+ * @constructor
+ * @class This is a class used to keep track of flag states
+ * which is used to control the busy cursor, big play button, among other
+ * items in which multiple components can have an interest in hiding or
+ * showing a single element on the screen.
+ *
+ *
+ * Usage:
+ *
+ * // Declare a flags variable.
+ * var flags = new minplayer.flags();
+ *
+ * // Set the flag based on two components interested in the flag.
+ * flags.setFlag("component1", true);
+ * flags.setFlag("component2", true);
+ *
+ * // Print out the value of the flags. ( Prints 3 )
+ * console.log(flags.flags);
+ *
+ * // Now unset a single components flag.
+ * flags.setFlag("component1", false);
+ *
+ * // Print out the value of the flags.
+ * console.log(flags.flags);
+ *
+ * // Unset the other components flag.
+ * flags.setFlag("component2", false);
+ *
+ * // Print out the value of the flags.
+ * console.log(flags.flags);
+ *
+ *
+ */
+minplayer.flags = function() {
+
+ /** The flag. */
+ this.flag = 0;
+
+ /** Id map to reference id with the flag index. */
+ this.ids = {};
+
+ /** The number of flags. */
+ this.numFlags = 0;
+};
+
+/**
+ * Sets a flag based on boolean logic operators.
+ *
+ * @param {string} id The id of the controller interested in this flag.
+ * @param {boolean} value The value of this flag ( true or false ).
+ */
+minplayer.flags.prototype.setFlag = function(id, value) {
+
+ // Define this id if it isn't present.
+ if (!this.ids.hasOwnProperty(id)) {
+ this.ids[id] = this.numFlags;
+ this.numFlags++;
+ }
+
+ // Use binary operations to keep track of the flag state
+ if (value) {
+ this.flag |= (1 << this.ids[id]);
+ }
+ else {
+ this.flag &= ~(1 << this.ids[id]);
+ }
+};
diff --git a/core/modules/file/player/src/minplayer.image.js b/core/modules/file/player/src/minplayer.image.js
new file mode 100644
index 0000000..d367e89
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.image.js
@@ -0,0 +1,143 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/**
+ * @constructor
+ * @class A class to easily handle images.
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.image = function(context, options) {
+
+ // Determine if the image is loaded.
+ this.loaded = false;
+
+ // The image loader.
+ this.loader = null;
+
+ // The ratio of the image.
+ this.ratio = 0;
+
+ // The image element.
+ this.img = null;
+
+ // Derive from display
+ minplayer.display.call(this, 'image', context, options);
+};
+
+/** Derive from minplayer.display. */
+minplayer.image.prototype = new minplayer.display();
+
+/** Reset the constructor. */
+minplayer.image.prototype.constructor = minplayer.image;
+
+/**
+ * @see minplayer.plugin.construct
+ */
+minplayer.image.prototype.construct = function() {
+
+ // Say we need to resize.
+ this.allowResize = true;
+
+ // Call the media display constructor.
+ minplayer.display.prototype.construct.call(this);
+
+ // Set the container to not show any overflow...
+ this.display.css('overflow', 'hidden');
+
+ // Create the image loader.
+ var _this = this;
+
+ /** The loader for the image. */
+ this.loader = new Image();
+
+ /** Register for when the image is loaded within the loader. */
+ this.loader.onload = function() {
+ _this.loaded = true;
+ _this.ratio = (_this.loader.width / _this.loader.height);
+ _this.resize();
+ _this.trigger('loaded');
+ };
+
+ // We are now ready.
+ this.ready();
+};
+
+/**
+ * Loads an image.
+ *
+ * @param {string} src The source of the image to load.
+ */
+minplayer.image.prototype.load = function(src) {
+
+ // First clear the previous image.
+ this.clear(function() {
+
+ // Create the new image, and append to the display.
+ this.img = jQuery(document.createElement('img')).attr({src: ''}).hide();
+ this.display.append(this.img);
+ this.loader.src = src;
+ });
+};
+
+/**
+ * Clears an image.
+ *
+ * @param {function} callback Called when the image is done clearing.
+ */
+minplayer.image.prototype.clear = function(callback) {
+ this.loaded = false;
+ if (this.img) {
+ var _this = this;
+ this.img.fadeOut(function() {
+ _this.img.attr('src', '');
+ _this.loader.src = '';
+ $(this).remove();
+ callback.call(_this);
+ });
+ }
+ else {
+ callback.call(this);
+ }
+};
+
+/**
+ * Resize the image provided a width and height or nothing.
+ *
+ * @param {integer} width (optional) The width of the container.
+ * @param {integer} height (optional) The height of the container.
+ */
+minplayer.image.prototype.resize = function(width, height) {
+ width = width || this.display.width();
+ height = height || this.display.height();
+ if (width && height && this.loaded) {
+
+ // Get the scaled rectangle.
+ var rect = this.getScaledRect(this.ratio, {
+ width: width,
+ height: height
+ });
+
+ // Now set this image to the new size.
+ if (this.img) {
+ this.img.attr('src', this.loader.src).css({
+ marginLeft: rect.x,
+ marginTop: rect.y,
+ width: rect.width,
+ height: rect.height
+ });
+ }
+
+ // Show the container.
+ this.img.fadeIn();
+ }
+};
+
+/**
+ * @see minplayer.display#onResize
+ */
+minplayer.image.prototype.onResize = function() {
+
+ // Resize the image to fit.
+ this.resize();
+};
diff --git a/core/modules/file/player/src/minplayer.js b/core/modules/file/player/src/minplayer.js
new file mode 100644
index 0000000..68ac835
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.js
@@ -0,0 +1,346 @@
+// Add a way to instanciate using jQuery prototype.
+if (!jQuery.fn.minplayer) {
+
+ /**
+ * @constructor
+ *
+ * Define a jQuery minplayer prototype.
+ *
+ * @param {object} options The options for this jQuery prototype.
+ * @return {Array} jQuery object.
+ */
+ jQuery.fn.minplayer = function(options) {
+ return jQuery(this).each(function() {
+ options = options || {};
+ options.id = options.id || $(this).attr('id') || Math.random();
+ if (!minplayer.plugins[options.id]) {
+ var template = options.template || 'default';
+ if (minplayer[template]) {
+ new minplayer[template](jQuery(this), options);
+ }
+ else {
+ new minplayer(jQuery(this), options);
+ }
+ }
+ });
+ };
+}
+
+/**
+ * @constructor
+ * @extends minplayer.display
+ * @class The core media player class which governs the media player
+ * functionality.
+ *
+ * Usage:
+ *
+ *
+ * // Create a media player.
+ * var player = jQuery("#player").minplayer({
+ *
+ * });
+ *
+ *
+ *
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer = jQuery.extend(function(context, options) {
+
+ // Make sure we provide default options...
+ options = jQuery.extend({
+ id: 'player',
+ swfplayer: '',
+ wmode: 'transparent',
+ preload: true,
+ autoplay: false,
+ loop: false,
+ width: '100%',
+ height: '350px',
+ debug: false,
+ volume: 80,
+ files: [],
+ file: '',
+ preview: '',
+ attributes: {}
+ }, options);
+
+ // Setup the plugins.
+ options.plugins = jQuery.extend({
+ controller: 'default',
+ playLoader: 'default'
+ }, options.plugins);
+
+ // Derive from display
+ minplayer.display.call(this, 'player', context, options);
+}, minplayer);
+
+/** Derive from minplayer.display. */
+minplayer.prototype = new minplayer.display();
+
+/** Reset the constructor. */
+minplayer.prototype.constructor = minplayer;
+
+/**
+ * Define a way to debug.
+ */
+minplayer.console = console || {log: function(data) {}};
+
+/**
+ * @see minplayer.plugin.construct
+ */
+minplayer.prototype.construct = function() {
+
+ // Call the minplayer display constructor.
+ minplayer.display.prototype.construct.call(this);
+
+ // Load the plugins.
+ this.loadPlugins();
+
+ /** Variable to store the current media player. */
+ this.currentPlayer = 'html5';
+
+ // Add key events to the window.
+ this.addKeyEvents();
+
+ // Now load these files.
+ this.load(this.getFiles());
+
+ // Add the player events.
+ this.addEvents();
+
+ // The player is ready.
+ this.ready();
+};
+
+/**
+ * We need to bind to events we are interested in.
+ */
+minplayer.prototype.addEvents = function() {
+ var _this = this;
+ minplayer.get.call(this, this.options.id, null, function(plugin) {
+
+ // Bind to the error event.
+ plugin.bind('error', function(event, data) {
+
+ // If an error occurs within the html5 media player, then try
+ // to fall back to the flash player.
+ if (_this.currentPlayer == 'html5') {
+ _this.options.file.player = 'minplayer';
+ _this.loadPlayer();
+ }
+ else {
+ _this.error(data);
+ }
+ });
+
+ // Bind to the fullscreen event.
+ plugin.bind('fullscreen', function(event, data) {
+ _this.resize();
+ });
+ });
+};
+
+/**
+ * Sets an error on the player.
+ *
+ * @param {string} error The error to display on the player.
+ */
+minplayer.prototype.error = function(error) {
+ error = error || '';
+ if (this.elements.error) {
+
+ // Set the error text.
+ this.elements.error.text(error);
+ if (error) {
+ this.elements.error.show();
+ }
+ else {
+ this.elements.error.hide();
+ }
+ }
+};
+
+/**
+ * Adds key events to the player.
+ */
+minplayer.prototype.addKeyEvents = function() {
+
+ // Bind to key events...
+ jQuery(document).bind('keydown', {obj: this}, function(e) {
+ switch (e.keyCode) {
+ case 113: // ESC
+ case 27: // Q
+ e.data.obj.display.removeClass('fullscreen');
+ break;
+ }
+ });
+};
+
+/**
+ * Returns all the media files available for this player.
+ *
+ * @return {array} All the media files for this player.
+ */
+minplayer.prototype.getFiles = function() {
+ var files = [];
+ var mediaSrc = null;
+
+ // Get the files involved...
+ if (this.elements.media) {
+ mediaSrc = this.elements.media.attr('src');
+ if (mediaSrc) {
+ files.push({'path': mediaSrc});
+ }
+ jQuery('source', this.elements.media).each(function() {
+ files.push({
+ 'path': jQuery(this).attr('src'),
+ 'mimetype': jQuery(this).attr('type'),
+ 'codecs': jQuery(this).attr('codecs')
+ });
+ });
+ }
+
+ return files;
+};
+
+/**
+ * Returns the full media player object.
+ * @param {array} files An array of files to chose from.
+ * @return {object} The best media file to play in the current browser.
+ */
+minplayer.prototype.getMediaFile = function(files) {
+
+ // If there are no files then return null.
+ if (!files) {
+ return null;
+ }
+
+ // If the file is a single string, then return the file object.
+ if (typeof files === 'string') {
+ return new minplayer.file({'path': files});
+ }
+
+ // If the file is already a file object then just return.
+ if (files.path) {
+ return new minplayer.file(files);
+ }
+
+ // Add the files and get the best player to play.
+ var i = files.length, bestPriority = 0, mFile = null, file = null;
+ while (i--) {
+ file = files[i];
+
+ // Get the minplayer file object.
+ if (typeof file === 'string') {
+ file = new minplayer.file({'path': file});
+ }
+ else {
+ file = new minplayer.file(file);
+ }
+
+ // Determine the best file for this browser.
+ if (file.priority > bestPriority) {
+ mFile = file;
+ }
+ }
+
+ // Return the best minplayer file.
+ return mFile;
+};
+
+/**
+ * Loads a media player based on the current file.
+ */
+minplayer.prototype.loadPlayer = function() {
+
+ // Do nothing if there isn't a file.
+ if (!this.options.file) {
+ this.error('No media found.');
+ return;
+ }
+
+ if (!this.options.file.player) {
+ this.error('Cannot play media: ' + this.options.file.mimetype);
+ return;
+ }
+
+ // Reset the error.
+ this.error();
+
+ // Only destroy if the current player is different than the new player.
+ var player = this.options.file.player.toString();
+
+ // If there isn't media or if the players are different.
+ if (!this.media || (player !== this.currentPlayer)) {
+
+ // Set the current media player.
+ this.currentPlayer = player;
+
+ // Do nothing if we don't have a display.
+ if (!this.elements.display) {
+ this.error('No media display found.');
+ return;
+ }
+
+ // Store the queue.
+ var queue = this.media ? this.media.queue : {};
+
+ // Destroy the current media.
+ if (this.media) {
+ this.media.destroy();
+ }
+
+ // Get the class name and create the new player.
+ pClass = minplayer.players[this.options.file.player];
+
+ // Create the new media player.
+ this.media = new pClass(this.elements.display, this.options);
+
+ // Restore the queue.
+ this.media.queue = queue;
+
+ // Now get the media when it is ready.
+ this.get('media', function(media) {
+
+ // Load the media.
+ media.load();
+ });
+ }
+ // If the media object already exists...
+ else if (this.media) {
+
+ // Now load the different media file.
+ this.media.load(this.options.file);
+ }
+};
+
+/**
+ * Load a set of files or a single file for the media player.
+ *
+ * @param {array} files An array of files to chose from to load.
+ */
+minplayer.prototype.load = function(files) {
+
+ // Set the id and class.
+ var id = '', pClass = '';
+
+ // If no file was provided, then get it.
+ this.options.files = files || this.options.files;
+ this.options.file = this.getMediaFile(this.options.files);
+
+ // Now load the player.
+ this.loadPlayer();
+};
+
+/**
+ * Called when the player is resized.
+ */
+minplayer.prototype.resize = function() {
+
+ // Call onRezie for each plugin.
+ this.get(function(plugin) {
+ plugin.onResize();
+ });
+};
diff --git a/core/modules/file/player/src/minplayer.playLoader.base.js b/core/modules/file/player/src/minplayer.playLoader.base.js
new file mode 100644
index 0000000..ca6729d
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.playLoader.base.js
@@ -0,0 +1,182 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** Define the playLoader object. */
+minplayer.playLoader = minplayer.playLoader || {};
+
+/**
+ * @constructor
+ * @extends minplayer.display
+ * @class The play loader base class, which is used to control the busy
+ * cursor, big play button, and the opaque background which shows when the
+ * player is paused.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.playLoader.base = function(context, options) {
+
+ // Define the flags that control the busy cursor.
+ this.busy = new minplayer.flags();
+
+ // Define the flags that control the big play button.
+ this.bigPlay = new minplayer.flags();
+
+ /** The preview image. */
+ this.preview = null;
+
+ // Derive from display
+ minplayer.display.call(this, 'playLoader', context, options);
+};
+
+/** Derive from minplayer.display. */
+minplayer.playLoader.base.prototype = new minplayer.display();
+
+/** Reset the constructor. */
+minplayer.playLoader.base.prototype.constructor = minplayer.playLoader.base;
+
+/**
+ * The constructor.
+ */
+minplayer.playLoader.base.prototype.construct = function() {
+
+ // Call the media display constructor.
+ minplayer.display.prototype.construct.call(this);
+
+ // Get the media plugin.
+ this.get('media', function(media) {
+
+ // Only bind if this player does not have its own play loader.
+ if (!media.hasPlayLoader()) {
+
+ // Load the preview image.
+ this.loadPreview();
+
+ // Trigger a play event when someone clicks on the controller.
+ if (this.elements.bigPlay) {
+ this.elements.bigPlay.unbind().bind('click', function(event) {
+ event.preventDefault();
+ jQuery(this).hide();
+ media.play();
+ });
+ }
+
+ // Bind to the player events to control the play loader.
+ media.unbind('loadstart').bind('loadstart', {obj: this}, function(event) {
+ event.data.obj.busy.setFlag('media', true);
+ event.data.obj.bigPlay.setFlag('media', true);
+ if (event.data.obj.preview) {
+ event.data.obj.elements.preview.show();
+ }
+ event.data.obj.checkVisibility();
+ });
+ media.bind('waiting', {obj: this}, function(event) {
+ event.data.obj.busy.setFlag('media', true);
+ event.data.obj.checkVisibility();
+ });
+ media.bind('loadeddata', {obj: this}, function(event) {
+ event.data.obj.busy.setFlag('media', false);
+ event.data.obj.checkVisibility();
+ });
+ media.bind('playing', {obj: this}, function(event) {
+ event.data.obj.busy.setFlag('media', false);
+ event.data.obj.bigPlay.setFlag('media', false);
+ if (event.data.obj.preview) {
+ event.data.obj.elements.preview.hide();
+ }
+ event.data.obj.checkVisibility();
+ });
+ media.bind('pause', {obj: this}, function(event) {
+ event.data.obj.bigPlay.setFlag('media', true);
+ event.data.obj.checkVisibility();
+ });
+ }
+ else {
+
+ // Hide the busy cursor.
+ if (this.elements.busy) {
+ this.elements.busy.unbind().hide();
+ }
+
+ // Hide the big play button.
+ if (this.elements.bigPlay) {
+ this.elements.bigPlay.unbind().hide();
+ }
+
+ // Hide the display.
+ this.display.unbind().hide();
+ }
+ });
+
+ // We are now ready.
+ this.ready();
+};
+
+/**
+ * Loads the preview image.
+ */
+minplayer.playLoader.base.prototype.loadPreview = function() {
+
+ // If the preview element exists.
+ if (this.elements.preview) {
+
+ // Get the poster image.
+ if (!this.options.preview) {
+ this.options.preview = this.elements.media.attr('poster');
+ }
+
+ // Reset the media's poster image.
+ this.elements.media.attr('poster', '');
+
+ // If there is a preview to show...
+ if (this.options.preview) {
+
+ // Say that this has a preview.
+ this.elements.preview.addClass('has-preview').show();
+
+ // Create a new preview image.
+ this.preview = new minplayer.image(this.elements.preview, this.options);
+
+ // Create the image.
+ this.preview.load(this.options.preview);
+ }
+ else {
+
+ // Hide the preview.
+ this.elements.preview.hide();
+ }
+ }
+};
+
+/**
+ * Hide or show certain elements based on the state of the busy and big play
+ * button.
+ */
+minplayer.playLoader.base.prototype.checkVisibility = function() {
+
+ // Hide or show the busy cursor based on the flags.
+ if (this.busy.flag) {
+ this.elements.busy.show();
+ }
+ else {
+ this.elements.busy.hide();
+ }
+
+ // Hide or show the big play button based on the flags.
+ if (this.bigPlay.flag) {
+ this.elements.bigPlay.show();
+ }
+ else {
+ this.elements.bigPlay.hide();
+ }
+
+ // Show the control either flag is set.
+ if (this.bigPlay.flag || this.busy.flag) {
+ this.display.show();
+ }
+
+ // Hide the whole control if both flags are 0.
+ if (!this.bigPlay.flag && !this.busy.flag) {
+ this.display.hide();
+ }
+};
diff --git a/core/modules/file/player/src/minplayer.players.base.js b/core/modules/file/player/src/minplayer.players.base.js
new file mode 100644
index 0000000..307ff09
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.players.base.js
@@ -0,0 +1,564 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** All the media player implementations */
+minplayer.players = minplayer.players || {};
+
+/**
+ * @constructor
+ * @extends minplayer.display
+ * @class The base media player class where all media players derive from.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.players.base = function(context, options) {
+
+ // Derive from display
+ minplayer.display.call(this, 'media', context, options);
+};
+
+/** Derive from minplayer.display. */
+minplayer.players.base.prototype = new minplayer.display();
+
+/** Reset the constructor. */
+minplayer.players.base.prototype.constructor = minplayer.players.base;
+
+/**
+ * Get the priority of this media player.
+ *
+ * @return {number} The priority of this media player.
+ */
+minplayer.players.base.getPriority = function() {
+ return 0;
+};
+
+/**
+ * Returns the ID for the media being played.
+ *
+ * @param {object} file A {@link minplayer.file} object.
+ * @return {string} The ID for the provided media.
+ */
+minplayer.players.base.getMediaId = function(file) {
+ return '';
+};
+
+/**
+ * Determine if we can play the media file.
+ *
+ * @param {object} file A {@link minplayer.file} object.
+ * @return {boolean} If this player can play this media type.
+ */
+minplayer.players.base.canPlay = function(file) {
+ return false;
+};
+
+/**
+ * @see minplayer.plugin.construct
+ * @this minplayer.players.base
+ */
+minplayer.players.base.prototype.construct = function() {
+
+ // Call the media display constructor.
+ minplayer.display.prototype.construct.call(this);
+
+ // Reset the variables to initial state.
+ this.reset();
+
+ /** The currently loaded media file. */
+ this.mediaFile = this.options.file;
+
+ // Get the player display object.
+ if (!this.playerFound()) {
+
+ // Remove the media element if found
+ if (this.elements.media) {
+ this.elements.media.remove();
+ }
+
+ // Create a new media player element.
+ this.display.html(this.create());
+ }
+
+ // Get the player object...
+ this.player = this.getPlayer();
+
+ // Set the focus of the element based on if they click in or outside of it.
+ var _this = this;
+ jQuery(document).bind('click', function(e) {
+ if (jQuery(e.target).closest('#' + _this.options.id).length == 0) {
+ _this.hasFocus = false;
+ }
+ else {
+ _this.hasFocus = true;
+ }
+ });
+
+ // Bind to key events...
+ jQuery(document).bind('keydown', {obj: this}, function(e) {
+ if (e.data.obj.hasFocus) {
+ e.preventDefault();
+ switch (e.keyCode) {
+ case 32: // SPACE
+ case 179: // GOOGLE play/pause button.
+ if (e.data.obj.playing) {
+ e.data.obj.pause();
+ }
+ else {
+ e.data.obj.play();
+ }
+ break;
+ case 38: // UP
+ e.data.obj.setVolumeRelative(0.1);
+ break;
+ case 40: // DOWN
+ e.data.obj.setVolumeRelative(-0.1);
+ break;
+ case 37: // LEFT
+ case 227: // GOOGLE TV REW
+ e.data.obj.seekRelative(-0.05);
+ break;
+ case 39: // RIGHT
+ case 228: // GOOGLE TV FW
+ e.data.obj.seekRelative(0.05);
+ break;
+ }
+ }
+ });
+};
+
+/**
+ * @see minplayer.plugin.destroy.
+ */
+minplayer.players.base.prototype.destroy = function() {
+ minplayer.plugin.prototype.destroy.call(this);
+
+ // Reset the player.
+ this.reset();
+};
+
+/**
+ * Resets all variables.
+ */
+minplayer.players.base.prototype.reset = function() {
+
+ // Reset the ready flag.
+ this.playerReady = false;
+
+ // The duration of the player.
+ this.duration = new minplayer.async();
+
+ // The current play time of the player.
+ this.currentTime = new minplayer.async();
+
+ // The amount of bytes loaded in the player.
+ this.bytesLoaded = new minplayer.async();
+
+ // The total amount of bytes for the media.
+ this.bytesTotal = new minplayer.async();
+
+ // The bytes that the download started with.
+ this.bytesStart = new minplayer.async();
+
+ // The current volume of the player.
+ this.volume = new minplayer.async();
+
+ // Reset focus.
+ this.hasFocus = false;
+
+ // We are not playing.
+ this.playing = false;
+
+ // We are not loading.
+ this.loading = false;
+
+ // If the player exists, then unbind all events.
+ if (this.player) {
+ jQuery(this.player).unbind();
+ }
+};
+
+/**
+ * Create a polling timer.
+ * @param {function} callback The function to call when you poll.
+ */
+minplayer.players.base.prototype.poll = function(callback) {
+ var _this = this;
+ setTimeout(function later() {
+ if (callback.call(_this)) {
+ setTimeout(later, 1000);
+ }
+ }, 1000);
+};
+
+/**
+ * Called when the player is ready to recieve events and commands.
+ */
+minplayer.players.base.prototype.onReady = function() {
+ // Store the this pointer.
+ var _this = this;
+
+ // Set the ready flag.
+ this.playerReady = true;
+
+ // Set the volume to the default.
+ this.setVolume(this.options.volume / 100);
+
+ // Setup the progress interval.
+ this.loading = true;
+
+ // Create a poll to get the progress.
+ this.poll(function() {
+
+ // Only do this if the play interval is set.
+ if (_this.loading) {
+
+ // Get the bytes loaded asynchronously.
+ _this.getBytesLoaded(function(bytesLoaded) {
+
+ // Get the bytes total asynchronously.
+ _this.getBytesTotal(function(bytesTotal) {
+
+ // Trigger an event about the progress.
+ if (bytesLoaded || bytesTotal) {
+
+ // Get the bytes start, but don't require it.
+ var bytesStart = 0;
+ _this.getBytesStart(function(val) {
+ bytesStart = val;
+ });
+
+ // Trigger a progress event.
+ _this.trigger('progress', {
+ loaded: bytesLoaded,
+ total: bytesTotal,
+ start: bytesStart
+ });
+
+ // Say we are not longer loading if they are equal.
+ if (bytesLoaded >= bytesTotal) {
+ _this.loading = false;
+ }
+ }
+ });
+ });
+ }
+
+ return _this.loading;
+ });
+
+ // We are now ready.
+ this.ready();
+
+ // Trigger that the load has started.
+ this.trigger('loadstart');
+};
+
+/**
+ * Should be called when the media is playing.
+ */
+minplayer.players.base.prototype.onPlaying = function() {
+ // Store the this pointer.
+ var _this = this;
+
+ // Trigger an event that we are playing.
+ this.trigger('playing');
+
+ // Say that this player has focus.
+ this.hasFocus = true;
+
+ // Set the playInterval to true.
+ this.playing = true;
+
+ // Create a poll to get the timeupate.
+ this.poll(function() {
+
+ // Only do this if the play interval is set.
+ if (_this.playing) {
+
+ // Get the current time asyncrhonously.
+ _this.getCurrentTime(function(currentTime) {
+
+ // Get the duration asynchronously.
+ _this.getDuration(function(duration) {
+
+ // Convert these to floats.
+ currentTime = parseFloat(currentTime);
+ duration = parseFloat(duration);
+
+ // Trigger an event about the progress.
+ if (currentTime || duration) {
+
+ // Trigger an update event.
+ _this.trigger('timeupdate', {
+ currentTime: currentTime,
+ duration: duration
+ });
+ }
+ });
+ });
+ }
+
+ return _this.playing;
+ });
+};
+
+/**
+ * Should be called when the media is paused.
+ */
+minplayer.players.base.prototype.onPaused = function() {
+
+ // Trigger an event that we are paused.
+ this.trigger('pause');
+
+ // Remove focus.
+ this.hasFocus = false;
+
+ // Say we are not playing.
+ this.playing = false;
+};
+
+/**
+ * Should be called when the media is complete.
+ */
+minplayer.players.base.prototype.onComplete = function() {
+ // Stop the intervals.
+ this.playing = false;
+ this.loading = false;
+ this.hasFocus = false;
+ this.trigger('ended');
+};
+
+/**
+ * Should be called when the media is done loading.
+ */
+minplayer.players.base.prototype.onLoaded = function() {
+ this.trigger('loadeddata');
+};
+
+/**
+ * Should be called when the player is waiting.
+ */
+minplayer.players.base.prototype.onWaiting = function() {
+ this.trigger('waiting');
+};
+
+/**
+ * Called when an error occurs.
+ *
+ * @param {string} errorCode The error that was triggered.
+ */
+minplayer.players.base.prototype.onError = function(errorCode) {
+ this.hasFocus = false;
+ this.trigger('error', errorCode);
+};
+
+/**
+ * @see minplayer.players.base#isReady
+ * @return {boolean} Checks to see if the Flash is ready.
+ */
+minplayer.players.base.prototype.isReady = function() {
+
+ // Return that the player is set and the ready flag is good.
+ return (this.player && this.playerReady);
+};
+
+/**
+ * Determines if the player should show the playloader.
+ *
+ * @return {bool} If this player implements its own playLoader.
+ */
+minplayer.players.base.prototype.hasPlayLoader = function() {
+ return false;
+};
+
+/**
+ * Returns if the media player is already within the DOM.
+ *
+ * @return {boolean} TRUE - if the player is in the DOM, FALSE otherwise.
+ */
+minplayer.players.base.prototype.playerFound = function() {
+ return false;
+};
+
+/**
+ * Creates the media player and inserts it in the DOM.
+ *
+ * @return {object} The media player entity.
+ */
+minplayer.players.base.prototype.create = function() {
+ this.reset();
+ return null;
+};
+
+/**
+ * Returns the media player object.
+ *
+ * @return {object} The media player object.
+ */
+minplayer.players.base.prototype.getPlayer = function() {
+ return this.player;
+};
+
+/**
+ * Loads a new media player.
+ *
+ * @param {object} file A {@link minplayer.file} object.
+ */
+minplayer.players.base.prototype.load = function(file) {
+
+ // Store the media file for future lookup.
+ if (file) {
+ this.reset();
+ this.mediaFile = file;
+ }
+};
+
+/**
+ * Play the loaded media file.
+ */
+minplayer.players.base.prototype.play = function() {
+};
+
+/**
+ * Pause the loaded media file.
+ */
+minplayer.players.base.prototype.pause = function() {
+};
+
+/**
+ * Stop the loaded media file.
+ */
+minplayer.players.base.prototype.stop = function() {
+ this.playing = false;
+ this.loading = false;
+ this.hasFocus = false;
+};
+
+/**
+ * Seeks to relative position.
+ *
+ * @param {number} pos Relative position. -1 to 1 (percent), > 1 (seconds).
+ */
+minplayer.players.base.prototype.seekRelative = function(pos) {
+
+ // Get the current time asyncrhonously.
+ var _this = this;
+ this.getCurrentTime(function(currentTime) {
+
+ // Get the duration asynchronously.
+ _this.getDuration(function(duration) {
+
+ // Only do this if we have a duration.
+ if (duration) {
+
+ // Get the position.
+ var seekPos = 0;
+ if ((pos > -1) && (pos < 1)) {
+ seekPos = (currentTime / duration) + parseFloat(pos);
+ }
+ else {
+ seekPos = (currentTime + parseFloat(pos)) / duration;
+ }
+
+ // Set the seek value.
+ _this.seek(seekPos);
+ }
+ });
+ });
+};
+
+/**
+ * Seek the loaded media.
+ *
+ * @param {number} pos The position to seek the minplayer. 0 to 1.
+ */
+minplayer.players.base.prototype.seek = function(pos) {
+};
+
+/**
+ * Set the volume of the loaded minplayer.
+ *
+ * @param {number} vol -1 to 1 - The relative amount to increase or decrease.
+ */
+minplayer.players.base.prototype.setVolumeRelative = function(vol) {
+
+ // Get the volume
+ var _this = this;
+ this.getVolume(function(newVol) {
+ newVol += parseFloat(vol);
+ newVol = (newVol < 0) ? 0 : newVol;
+ newVol = (newVol > 1) ? 1 : newVol;
+ _this.setVolume(newVol);
+ });
+};
+
+/**
+ * Set the volume of the loaded minplayer.
+ *
+ * @param {number} vol The volume to set the media. 0 to 1.
+ */
+minplayer.players.base.prototype.setVolume = function(vol) {
+ this.trigger('volumeupdate', vol);
+};
+
+/**
+ * Get the volume from the loaded media.
+ *
+ * @param {function} callback Called when the volume is determined.
+ * @return {number} The volume of the media; 0 to 1.
+ */
+minplayer.players.base.prototype.getVolume = function(callback) {
+ return this.volume.get(callback);
+};
+
+/**
+ * Get the current time for the media being played.
+ *
+ * @param {function} callback Called when the time is determined.
+ * @return {number} The volume of the media; 0 to 1.
+ */
+minplayer.players.base.prototype.getCurrentTime = function(callback) {
+ return this.currentTime.get(callback);
+};
+
+/**
+ * Return the duration of the loaded media.
+ *
+ * @param {function} callback Called when the duration is determined.
+ * @return {number} The duration of the loaded media.
+ */
+minplayer.players.base.prototype.getDuration = function(callback) {
+ return this.duration.get(callback);
+};
+
+/**
+ * Return the start bytes for the loaded media.
+ *
+ * @param {function} callback Called when the start bytes is determined.
+ * @return {int} The bytes that were started.
+ */
+minplayer.players.base.prototype.getBytesStart = function(callback) {
+ return this.bytesStart.get(callback);
+};
+
+/**
+ * Return the bytes of media loaded.
+ *
+ * @param {function} callback Called when the bytes loaded is determined.
+ * @return {int} The amount of bytes loaded.
+ */
+minplayer.players.base.prototype.getBytesLoaded = function(callback) {
+ return this.bytesLoaded.get(callback);
+};
+
+/**
+ * Return the total amount of bytes.
+ *
+ * @param {function} callback Called when the bytes total is determined.
+ * @return {int} The total amount of bytes for this media.
+ */
+minplayer.players.base.prototype.getBytesTotal = function(callback) {
+ return this.bytesTotal.get(callback);
+};
+
diff --git a/core/modules/file/player/src/minplayer.players.flash.js b/core/modules/file/player/src/minplayer.players.flash.js
new file mode 100644
index 0000000..a6fbbb3
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.players.flash.js
@@ -0,0 +1,107 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** All the media player implementations */
+minplayer.players = minplayer.players || {};
+
+/**
+ * @constructor
+ * @extends minplayer.display
+ * @class The Flash media player class to control the flash fallback.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.players.flash = function(context, options) {
+
+ // Derive from players base.
+ minplayer.players.base.call(this, context, options);
+};
+
+/** Derive from minplayer.players.base. */
+minplayer.players.flash.prototype = new minplayer.players.base();
+
+/** Reset the constructor. */
+minplayer.players.flash.prototype.constructor = minplayer.players.flash;
+
+/**
+ * @see minplayer.players.base#getPriority
+ * @return {number} The priority of this media player.
+ */
+minplayer.players.flash.getPriority = function() {
+ return 0;
+};
+
+/**
+ * @see minplayer.players.base#canPlay
+ * @return {boolean} If this player can play this media type.
+ */
+minplayer.players.flash.canPlay = function(file) {
+ return false;
+};
+
+/**
+ * API to return the Flash player code provided params.
+ *
+ * @param {object} params The params used to populate the Flash code.
+ * @return {object} A Flash DOM element.
+ */
+minplayer.players.flash.getFlash = function(params) {
+ // Get the protocol.
+ var protocol = window.location.protocol;
+ if (protocol.charAt(protocol.length - 1) == ':') {
+ protocol = protocol.substring(0, protocol.length - 1);
+ }
+
+ // Convert the flashvars object to a string...
+ var flashVars = jQuery.param(params.flashvars);
+
+ // Set the codebase.
+ var codebase = protocol + '://fpdownload.macromedia.com';
+ codebase += '/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
+
+ // Get the HTML flash object string.
+ var flash = ' ';
+ flash += ' ';
+ flash += ' ';
+ flash += ' ';
+ flash += ' ';
+ flash += ' ';
+ flash += ' ';
+ flash += ' ';
+ flash += ' ';
+ return flash;
+};
+
+/**
+ * @see minplayer.players.base#playerFound
+ * @return {boolean} TRUE - if the player is in the DOM, FALSE otherwise.
+ */
+minplayer.players.flash.prototype.playerFound = function() {
+ return (this.display.find('object[playerType="flash"]').length > 0);
+};
+
+/**
+ * @see minplayer.players.base#getPlayer
+ * @return {object} The media player object.
+ */
+minplayer.players.flash.prototype.getPlayer = function() {
+ // IE needs the object, everyone else just needs embed.
+ var object = jQuery.browser.msie ? 'object' : 'embed';
+ return jQuery(object, this.display).eq(0)[0];
+};
diff --git a/core/modules/file/player/src/minplayer.players.html5.js b/core/modules/file/player/src/minplayer.players.html5.js
new file mode 100644
index 0000000..9bd9a32
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.players.html5.js
@@ -0,0 +1,312 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** All the media player implementations */
+minplayer.players = minplayer.players || {};
+
+/**
+ * @constructor
+ * @extends minplayer.display
+ * @class The HTML5 media player implementation.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.players.html5 = function(context, options) {
+
+ // Derive players base.
+ minplayer.players.base.call(this, context, options);
+};
+
+/** Derive from minplayer.players.base. */
+minplayer.players.html5.prototype = new minplayer.players.base();
+
+/** Reset the constructor. */
+minplayer.players.html5.prototype.constructor = minplayer.players.html5;
+
+/**
+ * @see minplayer.players.base#getPriority
+ * @return {number} The priority of this media player.
+ */
+minplayer.players.html5.getPriority = function() {
+ return 10;
+};
+
+/**
+ * @see minplayer.players.base#canPlay
+ * @return {boolean} If this player can play this media type.
+ */
+minplayer.players.html5.canPlay = function(file) {
+ switch (file.mimetype) {
+ case 'video/ogg':
+ return !!minplayer.playTypes.videoOGG;
+ case 'video/mp4':
+ return !!minplayer.playTypes.videoH264;
+ case 'video/x-webm':
+ case 'video/webm':
+ case 'application/octet-stream':
+ return !!minplayer.playTypes.videoWEBM;
+ case 'audio/ogg':
+ return !!minplayer.playTypes.audioOGG;
+ case 'audio/mpeg':
+ return !!minplayer.playTypes.audioMP3;
+ case 'audio/mp4':
+ return !!minplayer.playTypes.audioMP4;
+ default:
+ return false;
+ }
+};
+
+/**
+ * @see minplayer.plugin.construct
+ */
+minplayer.players.html5.prototype.construct = function() {
+
+ // Call base constructor.
+ minplayer.players.base.prototype.construct.call(this);
+
+ // Store the this pointer...
+ var _this = this;
+
+ // For the HTML5 player, we will just pass events along...
+ if (this.player) {
+
+ this.player.addEventListener('abort', function() {
+ _this.trigger('abort');
+ }, false);
+ this.player.addEventListener('loadstart', function() {
+ _this.onReady();
+ }, false);
+ this.player.addEventListener('loadeddata', function() {
+ _this.onLoaded();
+ }, false);
+ this.player.addEventListener('loadedmetadata', function() {
+ _this.onLoaded();
+ }, false);
+ this.player.addEventListener('canplaythrough', function() {
+ _this.onLoaded();
+ }, false);
+ this.player.addEventListener('ended', function() {
+ _this.onComplete();
+ }, false);
+ this.player.addEventListener('pause', function() {
+ _this.onPaused();
+ }, false);
+ this.player.addEventListener('play', function() {
+ _this.onPlaying();
+ }, false);
+ this.player.addEventListener('playing', function() {
+ _this.onPlaying();
+ }, false);
+ this.player.addEventListener('error', function() {
+ _this.trigger('error', 'An error occured - ' + this.error.code);
+ }, false);
+ this.player.addEventListener('waiting', function() {
+ _this.onWaiting();
+ }, false);
+ this.player.addEventListener('durationchange', function() {
+ _this.duration.set(this.duration);
+ _this.trigger('durationchange', {duration: this.duration});
+ }, false);
+ this.player.addEventListener('progress', function(event) {
+ _this.bytesTotal.set(event.total);
+ _this.bytesLoaded.set(event.loaded);
+ }, false);
+ }
+};
+
+/**
+ * @see minplayer.players.base#playerFound
+ * @return {boolean} TRUE - if the player is in the DOM, FALSE otherwise.
+ */
+minplayer.players.html5.prototype.playerFound = function() {
+ return (this.display.find(this.mediaFile.type).length > 0);
+};
+
+/**
+ * @see minplayer.players.base#create
+ * @return {object} The media player entity.
+ */
+minplayer.players.html5.prototype.create = function() {
+ minplayer.players.base.prototype.create.call(this);
+ var element = jQuery(document.createElement(this.mediaFile.type))
+ .attr(this.options.attributes)
+ .append(
+ jQuery(document.createElement('source')).attr({
+ 'src': this.mediaFile.path
+ })
+ );
+
+ // Fix the fluid width and height.
+ element.eq(0)[0].setAttribute('width', '100%');
+ element.eq(0)[0].setAttribute('height', '100%');
+ return element;
+};
+
+/**
+ * @see minplayer.players.base#getPlayer
+ * @return {object} The media player object.
+ */
+minplayer.players.html5.prototype.getPlayer = function() {
+ return this.options.elements.media.eq(0)[0];
+};
+
+/**
+ * @see minplayer.players.base#load
+ */
+minplayer.players.html5.prototype.load = function(file) {
+
+ if (file && this.isReady()) {
+
+ // Get the current source.
+ var src = this.options.elements.media.attr('src');
+
+ // If the source is different.
+ if (src != file.path) {
+
+ // Change the source...
+ var code = '' : '>';
+ this.options.elements.media.attr('src', '').empty().html(code);
+ }
+ }
+
+ // Always call the base first on load...
+ minplayer.players.base.prototype.load.call(this, file);
+};
+
+/**
+ * @see minplayer.players.base#play
+ */
+minplayer.players.html5.prototype.play = function() {
+ minplayer.players.base.prototype.play.call(this);
+ if (this.isReady()) {
+ this.player.play();
+ }
+};
+
+/**
+ * @see minplayer.players.base#pause
+ */
+minplayer.players.html5.prototype.pause = function() {
+ minplayer.players.base.prototype.pause.call(this);
+ if (this.isReady()) {
+ this.player.pause();
+ }
+};
+
+/**
+ * @see minplayer.players.base#stop
+ */
+minplayer.players.html5.prototype.stop = function() {
+ minplayer.players.base.prototype.stop.call(this);
+ if (this.isReady()) {
+ this.player.pause();
+ this.player.src = '';
+ }
+};
+
+/**
+ * @see minplayer.players.base#seek
+ */
+minplayer.players.html5.prototype.seek = function(pos) {
+ minplayer.players.base.prototype.seek.call(this, pos);
+ if (this.isReady()) {
+ this.player.currentTime = pos;
+ }
+};
+
+/**
+ * @see minplayer.players.base#setVolume
+ */
+minplayer.players.html5.prototype.setVolume = function(vol) {
+ minplayer.players.base.prototype.setVolume.call(this, vol);
+ if (this.isReady()) {
+ this.player.volume = vol;
+ }
+};
+
+/**
+ * @see minplayer.players.base#getVolume
+ */
+minplayer.players.html5.prototype.getVolume = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.volume);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getDuration
+ */
+minplayer.players.html5.prototype.getDuration = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.duration);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getCurrentTime
+ */
+minplayer.players.html5.prototype.getCurrentTime = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.currentTime);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesLoaded
+ */
+minplayer.players.html5.prototype.getBytesLoaded = function(callback) {
+ if (this.isReady()) {
+ var loaded = 0;
+
+ // Check several different possibilities.
+ if (this.bytesLoaded.value) {
+ loaded = this.bytesLoaded.value;
+ }
+ else if (this.player.buffered &&
+ this.player.buffered.length > 0 &&
+ this.player.buffered.end &&
+ this.player.duration) {
+ loaded = this.player.buffered.end(0);
+ }
+ else if (this.player.bytesTotal != undefined &&
+ this.player.bytesTotal > 0 &&
+ this.player.bufferedBytes != undefined) {
+ loaded = this.player.bufferedBytes;
+ }
+
+ // Return the loaded amount.
+ callback(loaded);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesTotal
+ */
+minplayer.players.html5.prototype.getBytesTotal = function(callback) {
+ if (this.isReady()) {
+
+ var total = 0;
+
+ // Check several different possibilities.
+ if (this.bytesTotal.value) {
+ total = this.bytesTotal.value;
+ }
+ else if (this.player.buffered &&
+ this.player.buffered.length > 0 &&
+ this.player.buffered.end &&
+ this.player.duration) {
+ total = this.player.duration;
+ }
+ else if (this.player.bytesTotal != undefined &&
+ this.player.bytesTotal > 0 &&
+ this.player.bufferedBytes != undefined) {
+ total = this.player.bytesTotal;
+ }
+
+ // Return the loaded amount.
+ callback(total);
+ }
+};
diff --git a/core/modules/file/player/src/minplayer.players.minplayer.js b/core/modules/file/player/src/minplayer.players.minplayer.js
new file mode 100644
index 0000000..5b339a2
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.players.minplayer.js
@@ -0,0 +1,266 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** All the media player implementations */
+minplayer.players = minplayer.players || {};
+
+/**
+ * @constructor
+ * @extends minplayer.display
+ * @class The Flash media player class to control the flash fallback.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.players.minplayer = function(context, options) {
+
+ // Derive from players flash.
+ minplayer.players.flash.call(this, context, options);
+};
+
+/** Derive from minplayer.players.flash. */
+minplayer.players.minplayer.prototype = new minplayer.players.flash();
+
+/** Reset the constructor. */
+minplayer.players.minplayer.prototype.constructor = minplayer.players.minplayer;
+
+/**
+ * Called when the Flash player is ready.
+ *
+ * @param {string} id The media player ID.
+ */
+window.onFlashPlayerReady = function(id) {
+ var media = minplayer.get(id, 'media');
+ if (media) {
+ media.onReady();
+ }
+};
+
+/**
+ * Called when the Flash player updates.
+ *
+ * @param {string} id The media player ID.
+ * @param {string} eventType The event type that was triggered.
+ */
+window.onFlashPlayerUpdate = function(id, eventType) {
+ var media = minplayer.get(id, 'media');
+ if (media) {
+ media.onMediaUpdate(eventType);
+ }
+};
+
+/**
+ * Used to debug from the Flash player to the browser console.
+ *
+ * @param {string} debug The debug string.
+ */
+window.onFlashPlayerDebug = function(debug) {
+ minplayer.console.log(debug);
+};
+
+/**
+ * @see minplayer.players.base#getPriority
+ * @return {number} The priority of this media player.
+ */
+minplayer.players.minplayer.getPriority = function() {
+ return 1;
+};
+
+/**
+ * @see minplayer.players.base#canPlay
+ * @return {boolean} If this player can play this media type.
+ */
+minplayer.players.minplayer.canPlay = function(file) {
+ switch (file.mimetype) {
+ case 'video/mp4':
+ case 'video/x-webm':
+ case 'video/webm':
+ case 'application/octet-stream':
+ case 'video/quicktime':
+ case 'video/3gpp2':
+ case 'video/3gpp':
+ case 'application/x-shockwave-flash':
+ case 'audio/mpeg':
+ case 'audio/mp4':
+ case 'audio/aac':
+ case 'audio/vnd.wave':
+ case 'audio/x-ms-wma':
+ return true;
+
+ default:
+ return false;
+ }
+};
+
+/**
+ * @see minplayer.players.base#create
+ * @return {object} The media player entity.
+ */
+minplayer.players.minplayer.prototype.create = function() {
+ minplayer.players.flash.prototype.create.call(this);
+
+ // The flash variables for this flash player.
+ var flashVars = {
+ 'id': this.options.id,
+ 'debug': this.options.debug,
+ 'config': 'nocontrols',
+ 'file': this.mediaFile.path,
+ 'autostart': this.options.autoplay
+ };
+
+ // Return a flash media player object.
+ return minplayer.players.flash.getFlash({
+ swf: this.options.swfplayer,
+ id: this.options.id + '_player',
+ width: this.options.width,
+ height: '100%',
+ flashvars: flashVars,
+ wmode: this.options.wmode
+ });
+};
+
+/**
+ * Called when the Flash player has an update.
+ *
+ * @param {string} eventType The event that was triggered in the player.
+ */
+minplayer.players.minplayer.prototype.onMediaUpdate = function(eventType) {
+ switch (eventType) {
+ case 'mediaMeta':
+ this.onLoaded();
+ break;
+ case 'mediaPlaying':
+ this.onPlaying();
+ break;
+ case 'mediaPaused':
+ this.onPaused();
+ break;
+ case 'mediaComplete':
+ this.onComplete();
+ break;
+ }
+};
+
+/**
+ * @see minplayer.players.base#load
+ */
+minplayer.players.minplayer.prototype.load = function(file) {
+ minplayer.players.flash.prototype.load.call(this, file);
+ if (file && this.isReady()) {
+ this.player.loadMedia(file.path, file.stream);
+ }
+};
+
+/**
+ * @see minplayer.players.base#play
+ */
+minplayer.players.minplayer.prototype.play = function() {
+ minplayer.players.flash.prototype.play.call(this);
+ if (this.isReady()) {
+ this.player.playMedia();
+ }
+};
+
+/**
+ * @see minplayer.players.base#pause
+ */
+minplayer.players.minplayer.prototype.pause = function() {
+ minplayer.players.flash.prototype.pause.call(this);
+ if (this.isReady()) {
+ this.player.pauseMedia();
+ }
+};
+
+/**
+ * @see minplayer.players.base#stop
+ */
+minplayer.players.minplayer.prototype.stop = function() {
+ minplayer.players.flash.prototype.stop.call(this);
+ if (this.isReady()) {
+ this.player.stopMedia();
+ }
+};
+
+/**
+ * @see minplayer.players.base#seek
+ */
+minplayer.players.minplayer.prototype.seek = function(pos) {
+ minplayer.players.flash.prototype.seek.call(this, pos);
+ if (this.isReady()) {
+ this.player.seekMedia(pos);
+ }
+};
+
+/**
+ * @see minplayer.players.base#setVolume
+ */
+minplayer.players.minplayer.prototype.setVolume = function(vol) {
+ minplayer.players.flash.prototype.setVolume.call(this, vol);
+ if (this.isReady()) {
+ this.player.setVolume(vol);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getVolume
+ */
+minplayer.players.minplayer.prototype.getVolume = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getVolume());
+ }
+};
+
+/**
+ * @see minplayer.players.flash#getDuration
+ */
+minplayer.players.minplayer.prototype.getDuration = function(callback) {
+ if (this.isReady()) {
+
+ // Check to see if it is immediately available.
+ var duration = this.player.getDuration();
+ if (duration) {
+ callback(duration);
+ }
+ else {
+
+ // If not, then check every half second...
+ var _this = this;
+ setTimeout(function check() {
+ duration = _this.player.getDuration();
+ if (duration) {
+ callback(duration);
+ }
+ else {
+ setTimeout(check, 500);
+ }
+ }, 500);
+ }
+ }
+};
+
+/**
+ * @see minplayer.players.base#getCurrentTime
+ */
+minplayer.players.minplayer.prototype.getCurrentTime = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getCurrentTime());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesLoaded
+ */
+minplayer.players.minplayer.prototype.getBytesLoaded = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getMediaBytesLoaded());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesTotal.
+ */
+minplayer.players.minplayer.prototype.getBytesTotal = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getMediaBytesTotal());
+ }
+};
diff --git a/core/modules/file/player/src/minplayer.players.vimeo.js b/core/modules/file/player/src/minplayer.players.vimeo.js
new file mode 100644
index 0000000..2db10d0
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.players.vimeo.js
@@ -0,0 +1,259 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** All the media player implementations */
+minplayer.players = minplayer.players || {};
+
+/**
+ * @constructor
+ * @extends minplayer.players.base
+ * @class The vimeo media player.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.players.vimeo = function(context, options) {
+
+ // Derive from players base.
+ minplayer.players.base.call(this, context, options);
+};
+
+/** Derive from minplayer.players.base. */
+minplayer.players.vimeo.prototype = new minplayer.players.base();
+
+/** Reset the constructor. */
+minplayer.players.vimeo.prototype.constructor = minplayer.players.vimeo;
+
+/**
+ * @see minplayer.players.base#getPriority
+ * @return {number} The priority of this media player.
+ */
+minplayer.players.vimeo.getPriority = function() {
+ return 10;
+};
+
+/**
+ * @see minplayer.players.base#canPlay
+ * @return {boolean} If this player can play this media type.
+ */
+minplayer.players.vimeo.canPlay = function(file) {
+
+ // Check for the mimetype for vimeo.
+ if (file.mimetype === 'video/vimeo') {
+ return true;
+ }
+
+ // If the path is a vimeo path, then return true.
+ return (file.path.search(/^http(s)?\:\/\/(www\.)?vimeo\.com/i) === 0);
+};
+
+/**
+ * Return the ID for a provided media file.
+ *
+ * @param {object} file A {@link minplayer.file} object.
+ * @return {string} The ID for the provided media.
+ */
+minplayer.players.vimeo.getMediaId = function(file) {
+ var regex = /^http[s]?\:\/\/(www\.)?vimeo\.com\/(\?v\=)?([0-9]+)/i;
+ if (file.path.search(regex) === 0) {
+ return file.path.replace(regex, '$3');
+ }
+ else {
+ return file.path;
+ }
+};
+
+/**
+ * @see minplayer.players.base#reset
+ */
+minplayer.players.vimeo.prototype.reset = function() {
+
+ // Reset the flash variables..
+ minplayer.players.base.prototype.reset.call(this);
+};
+
+/**
+ * @see minplayer.players.base#create
+ * @return {object} The media player entity.
+ */
+minplayer.players.vimeo.prototype.create = function() {
+ minplayer.players.base.prototype.create.call(this);
+
+ // Insert the Vimeo Froogaloop player.
+ var tag = document.createElement('script');
+ tag.src = 'http://a.vimeocdn.com/js/froogaloop2.min.js';
+ var firstScriptTag = document.getElementsByTagName('script')[0];
+ firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
+
+ // Create the iframe for this player.
+ var iframe = document.createElement('iframe');
+ iframe.setAttribute('id', this.options.id + '-player');
+ iframe.setAttribute('type', 'text/html');
+ iframe.setAttribute('width', '100%');
+ iframe.setAttribute('height', '100%');
+ iframe.setAttribute('frameborder', '0');
+
+ // Get the source.
+ var src = 'http://player.vimeo.com/video/';
+ src += this.mediaFile.id + '?';
+
+ // Add the parameters to the src.
+ src += jQuery.param({
+ 'wmode': 'opaque',
+ 'api': 1,
+ 'player_id': this.options.id + '-player',
+ 'title': 0,
+ 'byline': 0,
+ 'portrait': 0,
+ 'autoplay': this.options.autoplay,
+ 'loop': this.options.loop
+ });
+
+ // Set the source of the iframe.
+ iframe.setAttribute('src', src);
+
+ // Now register this player when the froogaloop code is loaded.
+ var _this = this;
+ setTimeout(function check() {
+ if (window.Froogaloop) {
+ _this.player = window.Froogaloop(iframe);
+ _this.player.addEvent('ready', function() {
+ _this.onReady();
+ });
+ }
+ else {
+ setTimeout(check, 200);
+ }
+ }, 200);
+
+ // Trigger that the load has started.
+ this.trigger('loadstart');
+
+ // Return the player.
+ return iframe;
+};
+
+/**
+ * @see minplayer.players.base#onReady
+ */
+minplayer.players.vimeo.prototype.onReady = function(player_id) {
+ // Store the this pointer within this context.
+ var _this = this;
+
+ // Add the other listeners.
+ this.player.addEvent('loadProgress', function(progress) {
+
+ // Set the duration, bytesLoaded, and bytesTotal.
+ _this.duration.set(parseFloat(progress.duration));
+ _this.bytesLoaded.set(progress.bytesLoaded);
+ _this.bytesTotal.set(progress.bytesTotal);
+ });
+
+ this.player.addEvent('playProgress', function(progress) {
+
+ // Set the duration and current time.
+ _this.duration.set(parseFloat(progress.duration));
+ _this.currentTime.set(parseFloat(progress.seconds));
+ });
+
+ this.player.addEvent('play', function() {
+ _this.onPlaying();
+ });
+
+ this.player.addEvent('pause', function() {
+ _this.onPaused();
+ });
+
+ this.player.addEvent('finish', function() {
+ _this.onComplete();
+ });
+
+ minplayer.players.base.prototype.onReady.call(this);
+ this.onLoaded();
+};
+
+/**
+ * Checks to see if this player can be found.
+ * @return {bool} TRUE - Player is found, FALSE - otherwise.
+ */
+minplayer.players.vimeo.prototype.playerFound = function() {
+ var iframe = this.display.find('iframe#' + this.options.id + '-player');
+ return (iframe.length > 0);
+};
+
+/**
+ * @see minplayer.players.base#play
+ */
+minplayer.players.vimeo.prototype.play = function() {
+ minplayer.players.base.prototype.play.call(this);
+ if (this.isReady()) {
+ this.player.api('play');
+ }
+};
+
+/**
+ * @see minplayer.players.base#pause
+ */
+minplayer.players.vimeo.prototype.pause = function() {
+ minplayer.players.base.prototype.pause.call(this);
+ if (this.isReady()) {
+ this.player.api('pause');
+ }
+};
+
+/**
+ * @see minplayer.players.base#stop
+ */
+minplayer.players.vimeo.prototype.stop = function() {
+ minplayer.players.base.prototype.stop.call(this);
+ if (this.isReady()) {
+ this.player.api('unload');
+ }
+};
+
+/**
+ * @see minplayer.players.base#seek
+ */
+minplayer.players.vimeo.prototype.seek = function(pos) {
+ minplayer.players.base.prototype.seek.call(this, pos);
+ if (this.isReady()) {
+ this.player.api('seekTo', pos);
+ }
+};
+
+/**
+ * @see minplayer.players.base#setVolume
+ */
+minplayer.players.vimeo.prototype.setVolume = function(vol) {
+ minplayer.players.base.prototype.setVolume.call(this, vol);
+ if (this.isReady()) {
+ this.volume.set(vol);
+ this.player.api('setVolume', vol);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getVolume
+ */
+minplayer.players.vimeo.prototype.getVolume = function(callback) {
+ var _this = this;
+ this.player.api('getVolume', function(vol) {
+ callback(vol);
+ });
+};
+
+/**
+ * @see minplayer.players.base#getDuration.
+ */
+minplayer.players.vimeo.prototype.getDuration = function(callback) {
+ if (this.isReady()) {
+ if (this.duration.value) {
+ callback(this.duration.value);
+ }
+ else {
+ this.player.api('getDuration', function(duration) {
+ callback(duration);
+ });
+ }
+ }
+};
diff --git a/core/modules/file/player/src/minplayer.players.youtube.js b/core/modules/file/player/src/minplayer.players.youtube.js
new file mode 100644
index 0000000..f3b98ec
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.players.youtube.js
@@ -0,0 +1,345 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+/** All the media player implementations */
+minplayer.players = minplayer.players || {};
+
+/**
+ * @constructor
+ * @extends minplayer.players.base
+ * @class The YouTube media player.
+ *
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.players.youtube = function(context, options) {
+
+ /** The quality of the YouTube stream. */
+ this.quality = 'default';
+
+ // Derive from players base.
+ minplayer.players.base.call(this, context, options);
+};
+
+/** Derive from minplayer.players.base. */
+minplayer.players.youtube.prototype = new minplayer.players.base();
+
+/** Reset the constructor. */
+minplayer.players.youtube.prototype.constructor = minplayer.players.youtube;
+
+/**
+ * @see minplayer.players.base#getPriority
+ * @return {number} The priority of this media player.
+ */
+minplayer.players.youtube.getPriority = function() {
+ return 10;
+};
+
+/**
+ * @see minplayer.players.base#canPlay
+ * @return {boolean} If this player can play this media type.
+ */
+minplayer.players.youtube.canPlay = function(file) {
+
+ // Check for the mimetype for youtube.
+ if (file.mimetype === 'video/youtube') {
+ return true;
+ }
+
+ // If the path is a YouTube path, then return true.
+ return (file.path.search(/^http(s)?\:\/\/(www\.)?youtube\.com/i) === 0);
+};
+
+/**
+ * Return the ID for a provided media file.
+ *
+ * @param {object} file A {@link minplayer.file} object.
+ * @return {string} The ID for the provided media.
+ */
+minplayer.players.youtube.getMediaId = function(file) {
+ var regex = /^http[s]?\:\/\/(www\.)?youtube\.com\/watch\?v=([a-zA-Z0-9]+)/i;
+ if (file.path.search(regex) === 0) {
+ return file.path.replace(regex, '$2');
+ }
+ else {
+ return file.path;
+ }
+};
+
+/**
+ * Register this youtube player so that multiple players can be present
+ * on the same page without event collision.
+ */
+minplayer.players.youtube.prototype.register = function() {
+
+ /**
+ * Register the standard youtube api ready callback.
+ */
+ window.onYouTubePlayerAPIReady = function() {
+
+ // Iterate over each media player.
+ jQuery.each(minplayer.get(null, 'player'), function(id, player) {
+
+ // Make sure this is the youtube player.
+ if (player.currentPlayer == 'youtube') {
+
+ // Create a new youtube player object for this instance only.
+ var playerId = id + '-player';
+
+ // Set this players media.
+ player.media.player = new YT.Player(playerId, {
+ events: {
+ 'onReady': function(event) {
+ player.media.onReady(event);
+ },
+ 'onStateChange': function(event) {
+ player.media.onPlayerStateChange(event);
+ },
+ 'onPlaybackQualityChange': function(newQuality) {
+ player.media.onQualityChange(newQuality);
+ },
+ 'onError': function(errorCode) {
+ player.media.onError(errorCode);
+ }
+ }
+ });
+ }
+ });
+ }
+};
+
+/**
+ * Translates the player state for the YouTube API player.
+ *
+ * @param {number} playerState The YouTube player state.
+ */
+minplayer.players.youtube.prototype.setPlayerState = function(playerState) {
+ switch (playerState) {
+ case YT.PlayerState.CUED:
+ break;
+ case YT.PlayerState.BUFFERING:
+ this.onWaiting();
+ break;
+ case YT.PlayerState.PAUSED:
+ this.onPaused();
+ break;
+ case YT.PlayerState.PLAYING:
+ this.onPlaying();
+ break;
+ case YT.PlayerState.ENDED:
+ this.onComplete();
+ break;
+ default:
+ break;
+ }
+};
+
+/**
+ * Called when an error occurs.
+ *
+ * @param {string} event The onReady event that was triggered.
+ */
+minplayer.players.youtube.prototype.onReady = function(event) {
+ minplayer.players.base.prototype.onReady.call(this);
+ this.onLoaded();
+};
+
+/**
+ * Checks to see if this player can be found.
+ * @return {bool} TRUE - Player is found, FALSE - otherwise.
+ */
+minplayer.players.youtube.prototype.playerFound = function() {
+ var iframe = this.display.find('iframe#' + this.options.id + '-player');
+ return (iframe.length > 0);
+};
+
+/**
+ * Called when the player state changes.
+ *
+ * @param {object} event A JavaScript Event.
+ */
+minplayer.players.youtube.prototype.onPlayerStateChange = function(event) {
+ this.setPlayerState(event.data);
+};
+
+/**
+ * Called when the player quality changes.
+ *
+ * @param {string} newQuality The new quality for the change.
+ */
+minplayer.players.youtube.prototype.onQualityChange = function(newQuality) {
+ this.quality = newQuality;
+};
+
+/**
+ * Determines if the player should show the playloader.
+ *
+ * @return {bool} If this player implements its own playLoader.
+ */
+minplayer.players.youtube.prototype.hasPlayLoader = function() {
+ return true;
+};
+
+/**
+ * @see minplayer.players.base#create
+ * @return {object} The media player entity.
+ */
+minplayer.players.youtube.prototype.create = function() {
+ minplayer.players.base.prototype.create.call(this);
+
+ // Insert the YouTube iframe API player.
+ var tag = document.createElement('script');
+ tag.src = 'http://www.youtube.com/player_api?enablejsapi=1';
+ var firstScriptTag = document.getElementsByTagName('script')[0];
+ firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
+
+ // Now register this player.
+ this.register();
+
+ // Create the iframe for this player.
+ var iframe = document.createElement('iframe');
+ iframe.setAttribute('id', this.options.id + '-player');
+ iframe.setAttribute('type', 'text/html');
+ iframe.setAttribute('width', '100%');
+ iframe.setAttribute('height', '100%');
+ iframe.setAttribute('frameborder', '0');
+
+ // Get the source.
+ var src = 'http://www.youtube.com/embed/';
+ src += this.mediaFile.id + '?';
+
+ // Determine the origin of this script.
+ var origin = location.protocol;
+ origin += '//' + location.hostname;
+ origin += (location.port && ':' + location.port);
+
+ // Add the parameters to the src.
+ src += jQuery.param({
+ 'wmode': 'opaque',
+ 'controls': 0,
+ 'enablejsapi': 1,
+ 'origin': origin,
+ 'autoplay': this.options.autoplay,
+ 'loop': this.options.loop
+ });
+
+ // Set the source of the iframe.
+ iframe.setAttribute('src', src);
+
+ // Return the player.
+ return iframe;
+};
+
+/**
+ * @see minplayer.players.base#load
+ */
+minplayer.players.youtube.prototype.load = function(file) {
+ minplayer.players.base.prototype.load.call(this, file);
+ if (file && this.isReady()) {
+ this.player.loadVideoById(file.id, 0, this.quality);
+ }
+};
+
+/**
+ * @see minplayer.players.base#play
+ */
+minplayer.players.youtube.prototype.play = function() {
+ minplayer.players.base.prototype.play.call(this);
+ if (this.isReady()) {
+ this.player.playVideo();
+ }
+};
+
+/**
+ * @see minplayer.players.base#pause
+ */
+minplayer.players.youtube.prototype.pause = function() {
+ minplayer.players.base.prototype.pause.call(this);
+ if (this.isReady()) {
+ this.player.pauseVideo();
+ }
+};
+
+/**
+ * @see minplayer.players.base#stop
+ */
+minplayer.players.youtube.prototype.stop = function() {
+ minplayer.players.base.prototype.stop.call(this);
+ if (this.isReady()) {
+ this.player.stopVideo();
+ }
+};
+
+/**
+ * @see minplayer.players.base#seek
+ */
+minplayer.players.youtube.prototype.seek = function(pos) {
+ minplayer.players.base.prototype.seek.call(this, pos);
+ if (this.isReady()) {
+ this.player.seekTo(pos, true);
+ }
+};
+
+/**
+ * @see minplayer.players.base#setVolume
+ */
+minplayer.players.youtube.prototype.setVolume = function(vol) {
+ minplayer.players.base.prototype.setVolume.call(this, vol);
+ if (this.isReady()) {
+ this.player.setVolume(vol * 100);
+ }
+};
+
+/**
+ * @see minplayer.players.base#getVolume
+ */
+minplayer.players.youtube.prototype.getVolume = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getVolume());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getDuration.
+ */
+minplayer.players.youtube.prototype.getDuration = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getDuration());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getCurrentTime
+ */
+minplayer.players.youtube.prototype.getCurrentTime = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getCurrentTime());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesStart.
+ */
+minplayer.players.youtube.prototype.getBytesStart = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getVideoStartBytes());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesLoaded.
+ */
+minplayer.players.youtube.prototype.getBytesLoaded = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getVideoBytesLoaded());
+ }
+};
+
+/**
+ * @see minplayer.players.base#getBytesTotal.
+ */
+minplayer.players.youtube.prototype.getBytesTotal = function(callback) {
+ if (this.isReady()) {
+ callback(this.player.getVideoBytesTotal());
+ }
+};
diff --git a/core/modules/file/player/src/minplayer.plugin.js b/core/modules/file/player/src/minplayer.plugin.js
new file mode 100644
index 0000000..70df312
--- /dev/null
+++ b/core/modules/file/player/src/minplayer.plugin.js
@@ -0,0 +1,519 @@
+/** The minplayer namespace. */
+minplayer = minplayer || {};
+
+/** Static array to keep track of all plugins. */
+minplayer.plugins = minplayer.plugins || {};
+
+/** Static array to keep track of queues. */
+minplayer.queue = minplayer.queue || [];
+
+/** Mutex lock to keep multiple triggers from occuring. */
+minplayer.lock = false;
+
+/**
+ * @constructor
+ * @class The base class for all plugins.
+ *
+ * @param {string} name The name of this plugin.
+ * @param {object} context The jQuery context.
+ * @param {object} options This components options.
+ */
+minplayer.plugin = function(name, context, options) {
+
+ /** The name of this plugin. */
+ this.name = name;
+
+ /** The ready flag. */
+ this.pluginReady = false;
+
+ /** The options for this plugin. */
+ this.options = options;
+
+ /** The event queue. */
+ this.queue = {};
+
+ /** Keep track of already triggered events. */
+ this.triggered = {};
+
+ /** Create a queue lock. */
+ this.lock = false;
+
+ // Only call the constructor if we have a context.
+ if (context) {
+
+ // Construct this plugin.
+ this.construct();
+ }
+};
+
+/**
+ * The constructor which is called once the context is set.
+ * Any class deriving from the plugin class should place all context
+ * dependant functionality within this function instead of the standard
+ * constructor function since it is called on object derivation as well
+ * as object creation.
+ */
+minplayer.plugin.prototype.construct = function() {
+
+ // Adds this as a plugin.
+ this.addPlugin();
+};
+
+/**
+ * Destructor.
+ */
+minplayer.plugin.prototype.destroy = function() {
+
+ // Unbind all events.
+ this.unbind();
+};
+
+/**
+ * Loads all of the available plugins.
+ */
+minplayer.plugin.prototype.loadPlugins = function() {
+
+ // Get all the plugins to load.
+ var instance = '';
+
+ // Iterate through all the plugins.
+ for (var name in this.options.plugins) {
+
+ // Only load if it does not already exist.
+ if (!minplayer.plugins[this.options.id][name]) {
+
+ // Get the instance name from the setting.
+ instance = this.options.plugins[name];
+
+ // If this object exists.
+ if (minplayer[name][instance]) {
+
+ // Declare a new object.
+ new minplayer[name][instance](this.display, this.options);
+ }
+ }
+ }
+};
+
+/**
+ * Plugins should call this method when they are ready.
+ */
+minplayer.plugin.prototype.ready = function() {
+
+ // Keep this plugin from triggering multiple ready events.
+ if (!this.pluginReady) {
+
+ // Set the ready flag.
+ this.pluginReady = true;
+
+ // Now trigger that I am ready.
+ this.trigger('ready');
+
+ // Check the queue.
+ this.checkQueue();
+ }
+};
+
+/**
+ * Adds a new plugin to this player.
+ *
+ * @param {string} name The name of this plugin.
+ * @param {object} plugin A new plugin object, derived from media.plugin.
+ */
+minplayer.plugin.prototype.addPlugin = function(name, plugin) {
+ name = name || this.name;
+ plugin = plugin || this;
+
+ // Make sure the plugin is valid.
+ if (plugin.isValid()) {
+
+ // If the plugins for this instance do not exist.
+ if (!minplayer.plugins[this.options.id]) {
+
+ // Initialize the plugins.
+ minplayer.plugins[this.options.id] = {};
+ }
+
+ // Add this plugin.
+ minplayer.plugins[this.options.id][name] = plugin;
+ }
+};
+
+/**
+ * Gets a plugin by name and calls callback when it is ready.
+ *
+ * @param {string} plugin The plugin of the plugin.
+ * @param {function} callback Called when the plugin is ready.
+ * @return {object} The plugin if no callback is provided.
+ */
+minplayer.plugin.prototype.get = function(plugin, callback) {
+
+ // If they pass just a callback, then return all plugins when ready.
+ if (typeof plugin === 'function') {
+ callback = plugin;
+ plugin = null;
+ }
+
+ // Return the minplayer.get equivalent.
+ return minplayer.get.call(this, this.options.id, plugin, callback);
+};
+
+/**
+ * Check the queue and execute it.
+ */
+minplayer.plugin.prototype.checkQueue = function() {
+
+ // Initialize our variables.
+ var q = null, i = 0, check = false, newqueue = [];
+
+ // Set the lock.
+ minplayer.lock = true;
+
+ // Iterate through all the queues.
+ var length = minplayer.queue.length;
+ for (i = 0; i < length; i++) {
+
+ // Get the queue.
+ q = minplayer.queue[i];
+
+ // Now check to see if this queue is about us.
+ check = !q.id && !q.plugin;
+ check |= (q.plugin == this.name) && (!q.id || (q.id == this.options.id));
+
+ // If the check passes...
+ if (check) {
+ check = minplayer.bind.call(
+ q.context,
+ q.event,
+ this.options.id,
+ this.name,
+ q.callback
+ );
+ }
+
+ // Add the queue back if it doesn't check out.
+ if (!check) {
+
+ // Add this back to the queue.
+ newqueue.push(q);
+ }
+ }
+
+ // Set the old queue to the new queue.
+ minplayer.queue = newqueue;
+
+ // Release the lock.
+ minplayer.lock = false;
+};
+
+/**
+ * Trigger a media event.
+ *
+ * @param {string} type The event type.
+ * @param {object} data The event data object.
+ * @return {object} The plugin object.
+ */
+minplayer.plugin.prototype.trigger = function(type, data) {
+ data = data || {};
+ data.plugin = this;
+
+ // Add this to our triggered array.
+ this.triggered[type] = data;
+
+ // Check to make sure the queue for this type exists.
+ if (this.queue[type]) {
+
+ var i = 0, queue = {};
+
+ // Iterate through all the callbacks in this queue.
+ for (i in this.queue[type]) {
+
+ // Setup the event object, and call the callback.
+ queue = this.queue[type][i];
+ queue.callback({target: this, data: queue.data}, data);
+ }
+ }
+
+ // Return the plugin object.
+ return this;
+};
+
+/**
+ * Bind to a media event.
+ *
+ * @param {string} type The event type.
+ * @param {object} data The data to bind with the event.
+ * @param {function} fn The callback function.
+ * @return {object} The plugin object.
+ **/
+minplayer.plugin.prototype.bind = function(type, data, fn) {
+
+ // Allow the data to be the callback.
+ if (typeof data === 'function') {
+ fn = data;
+ data = null;
+ }
+
+ // You must bind to a specific event and have a callback.
+ if (!type || !fn) {
+ return;
+ }
+
+ // Initialize the queue for this type.
+ this.queue[type] = this.queue[type] || [];
+
+ // Unbind any existing equivalent events.
+ this.unbind(type, fn);
+
+ // Now add this event to the queue.
+ this.queue[type].push({
+ callback: fn,
+ data: data
+ });
+
+ // Now see if this event has already been triggered.
+ if (this.triggered[type]) {
+
+ // Go ahead and trigger the event.
+ fn({target: this, data: data}, this.triggered[type]);
+ }
+
+ // Return the plugin.
+ return this;
+};
+
+/**
+ * Unbind a media event.
+ *
+ * @param {string} type The event type.
+ * @param {function} fn The callback function.
+ * @return {object} The plugin object.
+ **/
+minplayer.plugin.prototype.unbind = function(type, fn) {
+
+ // If this is locked then try again after 10ms.
+ if (this.lock) {
+ var _this = this;
+ setTimeout(function() {
+ _this.unbind(type, fn);
+ }, 10);
+ }
+
+ // Set the lock.
+ this.lock = true;
+
+ if (!type) {
+ this.queue = {};
+ }
+ else if (!fn) {
+ this.queue[type] = [];
+ }
+ else {
+ // Iterate through all the callbacks and search for equal callbacks.
+ var i = 0, queue = {};
+ for (i in this.queue[type]) {
+ if (this.queue[type][i].callback === fn) {
+ queue = this.queue[type].splice(1, 1);
+ delete queue;
+ }
+ }
+ }
+
+ // Reset the lock.
+ this.lock = false;
+
+ // Return the plugin.
+ return this;
+};
+
+/**
+ * Adds an item to the queue.
+ *
+ * @param {object} context The context which this is called within.
+ * @param {string} event The event to trigger on.
+ * @param {string} id The player ID.
+ * @param {string} plugin The name of the plugin.
+ * @param {function} callback Called when the event occurs.
+ */
+minplayer.addQueue = function(context, event, id, plugin, callback) {
+
+ // See if it is locked...
+ if (!minplayer.lock) {
+ minplayer.queue.push({
+ context: context,
+ id: id,
+ event: event,
+ plugin: plugin,
+ callback: callback
+ });
+ }
+ else {
+
+ // If so, then try again after 10 milliseconds.
+ setTimeout(function() {
+ minplayer.addQueue(context, id, event, plugin, callback);
+ }, 10);
+ }
+};
+
+/**
+ * Binds an event to a plugin instance, and if it doesn't exist, then caches
+ * it for a later time.
+ *
+ * @param {string} event The event to trigger on.
+ * @param {string} id The player ID.
+ * @param {string} plugin The name of the plugin.
+ * @param {function} callback Called when the event occurs.
+ * @return {boolean} If the bind was successful.
+ * @this The object in context who called this method.
+ */
+minplayer.bind = function(event, id, plugin, callback) {
+
+ // If no callback exists, then just return false.
+ if (!callback) {
+ return false;
+ }
+
+ // Get the plugins.
+ var inst = minplayer.plugins;
+
+ // See if this plugin exists.
+ if (inst[id][plugin]) {
+
+ // If so, then bind the event to this plugin.
+ inst[id][plugin].bind(event, {context: this}, function(event, data) {
+ callback.call(event.data.context, data.plugin);
+ });
+ return true;
+ }
+
+ // If not, then add it to the queue to bind later.
+ minplayer.addQueue(this, event, id, plugin, callback);
+
+ // Return that this wasn't handled.
+ return false;
+};
+
+/**
+ * The main API for minPlayer.
+ *
+ * Provided that this function takes three parameters, there are 8 different
+ * ways to use this api.
+ *
+ * id (0x100) - You want a specific player.
+ * plugin (0x010) - You want a specific plugin.
+ * callback (0x001) - You only want it when it is ready.
+ *
+ * 000 - You want all plugins from all players, ready or not.
+ *
+ * var plugins = minplayer.get();
+ *
+ * 001 - You want all plugins from all players, but only when ready.
+ *
+ * minplayer.get(function(plugin) {
+ * // Code goes here.
+ * });
+ *
+ * 010 - You want a specific plugin from all players, ready or not...
+ *
+ * var medias = minplayer.get(null, 'media');
+ *
+ * 011 - You want a specific plugin from all players, but only when ready.
+ *
+ * minplayer.get('player', function(player) {
+ * // Code goes here.
+ * });
+ *
+ * 100 - You want all plugins from a specific player, ready or not.
+ *
+ * var plugins = minplayer.get('player_id');
+ *
+ * 101 - You want all plugins from a specific player, but only when ready.
+ *
+ * minplayer.get('player_id', null, function(plugin) {
+ * // Code goes here.
+ * });
+ *
+ * 110 - You want a specific plugin from a specific player, ready or not.
+ *
+ * var plugin = minplayer.get('player_id', 'media');
+ *
+ * 111 - You want a specific plugin from a specific player, only when ready.
+ *
+ * minplayer.get('player_id', 'media', function(media) {
+ * // Code goes here.
+ * });
+ *
+ * @this The context in which this function was called.
+ * @param {string} id The ID of the widget to get the plugins from.
+ * @param {string} plugin The name of the plugin.
+ * @param {function} callback Called when the plugin is ready.
+ * @return {object} The plugin object if it is immediately available.
+ */
+minplayer.get = function(id, plugin, callback) {
+
+ // Normalize the arguments for a better interface.
+ if (typeof id === 'function') {
+ callback = id;
+ plugin = id = null;
+ }
+
+ if (typeof plugin === 'function') {
+ callback = plugin;
+ plugin = id;
+ id = null;
+ }
+
+ // Make sure the callback is a callback.
+ callback = (typeof callback === 'function') ? callback : null;
+
+ // Get the plugins.
+ var plugins = minplayer.plugins;
+
+ // 0x000
+ if (!id && !plugin && !callback) {
+ return plugins;
+ }
+ // 0x100
+ else if (id && !plugin && !callback) {
+ return plugins[id];
+ }
+ // 0x110
+ else if (id && plugin && !callback) {
+ return plugins[id][plugin];
+ }
+ // 0x111
+ else if (id && plugin && callback) {
+ minplayer.bind.call(this, 'ready', id, plugin, callback);
+ }
+ // 0x011
+ else if (!id && plugin && callback) {
+ for (var id in plugins) {
+ minplayer.bind.call(this, 'ready', id, plugin, callback);
+ }
+ }
+ // 0x101
+ else if (id && !plugin && callback) {
+ for (var plugin in plugins[id]) {
+ minplayer.bind.call(this, 'ready', id, plugin, callback);
+ }
+ }
+ // 0x010
+ else if (!id && plugin && !callback) {
+ var plugin_types = {};
+ for (var id in plugins) {
+ if (plugins.hasOwnProperty(id) && plugins[id].hasOwnProperty(plugin)) {
+ plugin_types[id] = plugins[id][plugin];
+ }
+ }
+ return plugin_types;
+ }
+ // 0x001
+ else {
+ for (var id in plugins) {
+ for (var plugin in plugins[id]) {
+ minplayer.bind.call(this, 'ready', id, plugin, callback);
+ }
+ }
+ }
+};
diff --git a/core/modules/file/player/templates/default/css/images/loader.gif b/core/modules/file/player/templates/default/css/images/loader.gif
new file mode 100644
index 0000000..5e2d167
Binary files /dev/null and b/core/modules/file/player/templates/default/css/images/loader.gif differ
diff --git a/core/modules/file/player/templates/default/css/images/pause-icon.png b/core/modules/file/player/templates/default/css/images/pause-icon.png
new file mode 100644
index 0000000..1787439
Binary files /dev/null and b/core/modules/file/player/templates/default/css/images/pause-icon.png differ
diff --git a/core/modules/file/player/templates/default/css/images/play-icon.png b/core/modules/file/player/templates/default/css/images/play-icon.png
new file mode 100644
index 0000000..71a3413
Binary files /dev/null and b/core/modules/file/player/templates/default/css/images/play-icon.png differ
diff --git a/core/modules/file/player/templates/default/css/images/volume-full-icon.png b/core/modules/file/player/templates/default/css/images/volume-full-icon.png
new file mode 100644
index 0000000..b0bfa43
Binary files /dev/null and b/core/modules/file/player/templates/default/css/images/volume-full-icon.png differ
diff --git a/core/modules/file/player/templates/default/css/images/volume-mute-icon.png b/core/modules/file/player/templates/default/css/images/volume-mute-icon.png
new file mode 100644
index 0000000..23979e3
Binary files /dev/null and b/core/modules/file/player/templates/default/css/images/volume-mute-icon.png differ
diff --git a/core/modules/file/player/templates/default/css/media_player_default.css b/core/modules/file/player/templates/default/css/media_player_default.css
new file mode 100644
index 0000000..77b8fb2
--- /dev/null
+++ b/core/modules/file/player/templates/default/css/media_player_default.css
@@ -0,0 +1,475 @@
+
+/* base styles */
+.media-player {}
+.media-player-play, .media-player-volume-button {
+ cursor: pointer;
+}
+.media-player-timer {
+ cursor: default;
+}
+
+.media-player {
+ position: relative;
+ background:#000;
+ border:1px solid #333;
+ font-family:"Trebuchet MS", Helvetica, sans-serif;
+ -moz-box-shadow:0px 5px 10px #333;/*no-important moz*/
+ -webkit-box-shadow:0px 5px 10px #333;/*no-important chrome*/
+}
+
+.media-player .media-player-error {
+ display:none;
+ position: absolute;
+ top: 80%;
+ left: 50%;
+ width: 320px;
+ height: 40px;
+ line-height: 40px;
+ margin: -20px 0 0 -160px;
+ text-align: center;
+ vertical-align: center;
+ border: none;
+ z-index:1000;
+ color: #fff;
+ opacity: 0.9;
+ border-radius: 10px;
+ -webkit-border-radius: 10px;
+ -moz-border-radius: 10px;
+ background: rgba(23, 35, 34, 0.9);
+ box-shadow: 2px 2px 4px #000;
+ -webkit-box-shadow: 2px 2px 4px #000;
+ -moz-box-shadow: 2px 2px 4px #000;
+}
+
+.media-player .media-player-display {
+ background-color:#000;
+ width:100%;
+ height:100%;
+}
+
+.media-player .media-player-preview {
+ width:100%;
+ height:100%;
+ position:absolute;
+ z-index:1;
+}
+
+.media-player .media-player-preview.has-preview {
+ background-color: rgb(0, 0, 0);
+}
+
+.media-player .media-player-play-loader {
+ width:100%;
+ height:100%;
+ position:absolute;
+ z-index:2;
+ background: rgb(0, 0, 0);
+ background: rgba(0, 0, 0, 0.3);
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#55000000, endColorstr=#55000000);
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#55000000, endColorstr=#55000000)";
+}
+
+.media-player .media-player-play-loader .media-player-loader {
+ width:42px;
+ height:10px;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ margin: -5px 0 0 -21px;
+ text-align:center;
+ vertical-align:center;
+ background: url(images/loader.gif) no-repeat;
+}
+
+/* Big play button */
+.media-player .media-player-play-loader .media-player-big-play {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ width: 80px;
+ height: 80px;
+ margin: -40px 0 0 -40px;
+ text-align: center;
+ vertical-align: center;
+ cursor: pointer !important;
+ border: none;
+ opacity: 0.9;
+ z-index:3;
+ border-radius: 10px;
+ -webkit-border-radius: 10px;
+ -moz-border-radius: 10px;
+ background: rgba(23, 35, 34, 0.746094);
+ box-shadow: 2px 2px 4px #000;
+ -webkit-box-shadow: 2px 2px 4px #000;
+ -moz-box-shadow: 2px 2px 4px #000;
+}
+
+.media-player .media-player-play-loader .media-player-big-play span {
+ margin: 22px 0 0 48px;
+ border-left: 36px solid white;
+ border-top: 18px solid transparent;
+ border-bottom: 18px solid transparent;
+}
+
+.media-player .media-player-play-loader .media-player-big-play span {
+ display: block;
+ font-size: 0;
+ line-height: 0;
+ width: 0;
+ height: 0;
+ margin: 20px 0 0 23px;
+ border-left: 40px solid white;
+ border-top: 20px solid transparent;
+ border-bottom: 20px solid transparent;
+}
+
+.media-player.fullscreen, .media-player.fullscreen .media-player-display, .media-player.fullscreen .media-player-play-loader {
+ position: fixed;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ overflow: hidden;
+ z-index:1000;
+ width: 100% !important;
+ height: 100% !important;
+}
+
+.media-player.fullscreen .media-player-play-loader {
+ z-index:1001;
+}
+
+.media-player .media-player-controls {
+ position: absolute;
+ display: block;
+ z-index:3;
+ bottom:0px;
+ left:0px;
+ right:0px;
+ height:30px;
+ background-color:rgba(0,0,0,0.5);
+}
+
+.media-player-controls-left {
+ float:left;
+ width:30px;
+ height:26px;
+ margin: 2px 0;
+ border-right:1px solid #eee;
+}
+
+.media-player.fullscreen .media-player-controls-left {
+ width:40px;
+ border:none;
+}
+
+.media-player-controls-right {
+ float:right;
+ width:120px;
+ height:30px;
+}
+
+.media-player.fullscreen .media-player-controls-right {
+ width:110px;
+}
+
+.media-player-controls-mid {
+ position:absolute;
+ left:40px;
+ right:130px;
+ height:30px;
+}
+
+.media-player.fullscreen .media-player-controls-mid {
+ left:50px;
+}
+
+.media-player .media-player-play, .media-player .media-player-volume, .media-player .media-player-timer {
+ float: left;
+}
+
+/* play, pause */
+.media-player .media-player-play, .media-player .media-player-pause {
+ display: block;
+ width: 22px;
+ height: 22px;
+ margin:2px 0 0 4px;
+ opacity: 0.7;
+ -moz-transition: all 0.2s ease-in-out; /* Firefox */
+ -webkit-transition: all 0.2s ease-in-out; /* Safari and Chrome */
+ -o-transition: all 0.2s ease-in-out; /* Opera */
+ transition: all 0.2s ease-in-out;
+}
+
+.media-player .media-player-play:hover, .media-player .media-player-pause:hover {
+ opacity: 1;
+}
+
+.media-player .media-player-play {
+ background: url(images/play-icon.png) no-repeat;
+}
+
+.media-player .media-player-pause {
+ background: url(images/pause-icon.png) no-repeat;
+ display:none;
+}
+
+/* seek */
+.media-player .media-player-seek {
+ position:relative;
+ height: 10px;
+ margin-top:9px;
+ border: 1px solid #494949;
+ -moz-border-radius:4px;
+ -webkit-border-radius:4px;
+ border-radius:4px;
+ background: #535353;
+ background-image: -moz-linear-gradient(top, #535353, #333333);
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #535353),color-stop(1, #333333));
+ box-shadow: inset 0 -3px 3px #333333;
+}
+
+.media-player .media-player-seek .ui-slider-handle {
+ width: 15px;
+ height: 15px;
+ border: 1px solid #333;
+ top: -4px;
+ z-index:20px;
+ -moz-border-radius:10px;
+ -webkit-border-radius:10px;
+ border-radius:10px;
+ background: #e6e6e6;
+ background-image: -moz-linear-gradient(top, #e6e6e6, #d5d5d5);
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #e6e6e6),color-stop(1, #d5d5d5));
+ box-shadow: inset 0 -3px 3px #d5d5d5;
+}
+
+.media-player .media-player-seek .ui-slider-handle.ui-state-hover {
+ background: #fff;
+}
+
+.media-player .media-player-seek .ui-slider-range {
+ -moz-border-radius:15px;
+ -webkit-border-radius:15px;
+ z-index:10px;
+ border-radius:15px;
+ background: #4cbae8;
+ background-image: -moz-linear-gradient(top, #4cbae8, #39a2ce);
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #4cbae8),color-stop(1, #39a2ce));
+ box-shadow: inset 0 -3px 3px #39a2ce;
+}
+
+.media-player .media-player-progress {
+ -moz-border-radius:15px;
+ -webkit-border-radius:15px;
+ z-index:8px;
+ width:0px;
+ height:10px;
+ border-radius:15px;
+ background: #266580;
+ background-image: -moz-linear-gradient(top, #266580, #153A4A);
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #266580),color-stop(1, #153A4A));
+ box-shadow: inset 0 -3px 3px #153A4A;
+}
+
+/* timer */
+.media-player .media-player-timer {
+ position:relative;
+ float:left;
+ color: #999;
+ margin-top:3px;
+ padding-right:6px;
+ font-size: 16px;
+ font-weight: bold;
+ border-right:1px solid #eee;
+}
+
+.media-player.fullscreen .media-player-timer {
+ border:none;
+ margin-top:4px;
+}
+
+/* volume */
+.media-player .media-player-volume {
+ position: absolute;
+ right:33px;
+ bottom:4px;
+ float:right;
+ overflow: hidden;
+ width: 20px;
+ height: 30px;
+ color: #fff;
+ padding: 0px 10px;
+ -moz-transition: all 0.1s ease-in-out; /* Firefox */
+ -webkit-transition: all 0.1s ease-in-out; /* Safari and Chrome */
+ -o-transition: all 0.2s ease-in-out; /* Opera */
+ transition: all 0.1s ease-in-out;
+}
+
+.media-player.fullscreen .media-player-volume {
+ right:40px;
+ bottom:13px;
+}
+
+.media-player .media-player-volume:hover {
+ height: 135px;
+ padding-top: 5px;
+}
+
+
+.media-player .media-player-volume:hover .media-player-volume-slider {
+ position: relative;
+ visibility: visible;
+ opacity: 1;
+}
+
+.media-player .media-player-volume-slider {
+ position: relative;
+ height: 100px;
+ width: 7px;
+ left: 4px;
+ visiblity: hidden;
+ opacity: 0;
+ border: 1px solid #444;
+ -moz-border-radius:15px;
+ -webkit-border-radius:15px;
+ border-radius:15px;
+ background: #535353;
+ background-image: -moz-linear-gradient(top, #535353, #333333);
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #535353),color-stop(1, #333333));
+ box-shadow: inset 0 3px 3px #333333;
+ -moz-transition: all 0.1s ease-in-out; /* Firefox */
+ -webkit-transition: all 0.1s ease-in-out; /* Safari and Chrome */
+ -o-transition: all 0.1s ease-in-out; /* Opera */
+ transition: all 0.1s ease-in-out;
+}
+
+.media-player .media-player-volume-slider .ui-slider-handle {
+ width: 12px;
+ height: 12px;
+ left: -4px;
+ margin-bottom:-0.6em;
+ margin-left:0;
+ border: 1px solid #333;
+ -moz-border-radius:10px;
+ -webkit-border-radius:10px;
+ border-radius:10px;
+ background: #e6e6e6;
+ background-image: -moz-linear-gradient(top, #e6e6e6, #d5d5d5);
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #e6e6e6),color-stop(1, #d5d5d5));
+
+ box-shadow: inset 0 3px 3px #d5d5d5;
+}
+
+.media-player .media-player-volume-slider .ui-slider-handle.ui-state-hover {
+ background: #fff;
+}
+
+.media-player .media-player-volume-slider .ui-slider-range {
+ -moz-border-radius:15px;
+ -webkit-border-radius:15px;
+ border-radius:15px;
+ background: #e6e6e6;
+ background-image: -moz-linear-gradient(top, #e6e6e6, #d5d5d5);
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #e6e6e6),color-stop(1, #d5d5d5));
+ box-shadow: inset 0 3px 3px #d5d5d5;
+}
+
+/* volume button */
+
+.media-player .media-player-volume-button {
+ position: absolute;
+ bottom: 0px;
+ display: block;
+ width: 22px;
+ height: 22px;
+ background: url(images/volume-full-icon.png) no-repeat;
+ text-indent: -9999px;
+ opacity: 0.8;
+}
+
+.media-player .media-player-volume-button:hover {
+ opacity: 1;
+}
+
+.media-player .media-player-volume-mute {
+ background: url(images/volume-mute-icon.png) no-repeat;
+}
+
+/* Fullscreen button */
+.media-player .media-player-fullscreen {
+ position: absolute;
+ right:6px;
+ bottom:7px;
+ width: 22px;
+ height: 14px;
+ border:1px solid #aaa;
+}
+
+.media-player.fullscreen .media-player-fullscreen {
+ right:14px;
+ bottom:16px;
+}
+
+.media-player .media-player-fullscreen-inner, .media-player.fullscreen .media-player-fullscreen:hover .media-player-fullscreen-inner {
+ position:absolute;
+ bottom:0;
+ width:16px;
+ height:8px;
+ background-color:#aaa;
+ -moz-transition: all 0.1s ease-in-out; /* Firefox */
+ -webkit-transition: all 0.1s ease-in-out; /* Safari and Chrome */
+ -o-transition: all 0.1s ease-in-out; /* Opera */
+ transition: all 0.1s ease-in-out;
+}
+
+.media-player .media-player-fullscreen:hover .media-player-fullscreen-inner, .media-player.fullscreen .media-player-fullscreen-inner {
+ width:20px;
+ height:12px;
+}
+
+.media-player.fullscreen .media-player-controls {
+ position: absolute;
+ z-index:1002;
+ width:500px;
+ left: 50%;
+ bottom:10px;
+ margin: 0 0 0 -260px;
+ padding: 10px;
+ border: 1px solid #2E2E2E;
+ -moz-border-radius: 5px; /* FF1+ */
+ -webkit-border-radius: 5px; /* Saf3+, Chrome */
+ border-radius: 5px; /* Opera 10.5, IE 9 */
+ background: #000000;
+ background-image: -moz-linear-gradient(top, #313131, #000000); /* FF3.6 */
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #313131),color-stop(1, #000000)); /* Saf4+, Chrome */
+ box-shadow: inset 0 15px 35px #535353;
+ -moz-transition: all 0.1s ease-in-out; /* Firefox */
+ -webkit-transition: all 0.1s ease-in-out; /* Safari and Chrome */
+ -o-transition: all 0.1s ease-in-out; /* Opera */
+ transition: all 0.1s ease-in-out;
+}
+
+
+/* needed jquery ui styles
+ * using these, we don't depend on jQuery UI's stylsheet
+*/
+.ui-slider-handle {
+ position: absolute;
+ z-index: 4;
+ display: block;
+ margin-left:-0.6em;
+ cursor: default;
+ outline: none;
+}
+
+.ui-slider-range {
+ display:block;
+ width:100%;
+ height:100%;
+ left:0;
+ bottom: 0;
+ border:0 none;
+ position:absolute;
+ z-index:3;
+}
\ No newline at end of file
diff --git a/core/modules/file/player/templates/default/js/minplayer.controller.default.js b/core/modules/file/player/templates/default/js/minplayer.controller.default.js
new file mode 100644
index 0000000..57c0b35
--- /dev/null
+++ b/core/modules/file/player/templates/default/js/minplayer.controller.default.js
@@ -0,0 +1,71 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+// Define the controller object.
+minplayer.controller = minplayer.controller || {};
+
+/**
+ * Constructor for the minplayer.controller
+ */
+minplayer.controller["default"] = function(context, options) {
+
+ // Derive from base controller
+ minplayer.controller.base.call(this, context, options);
+};
+
+/** Derive from controller.base. */
+minplayer.controller["default"].prototype = new minplayer.controller.base();
+minplayer.controller["default"].prototype.constructor = minplayer.controller["default"];
+
+/**
+ * Return the display for this plugin.
+ */
+minplayer.controller["default"].prototype.getDisplay = function(context, options) {
+
+ // See if we need to build out the controller.
+ if (context.build) {
+
+ // Prepend the control template.
+ context.prepend('\
+
\
+ ');
+ }
+
+ return jQuery('.media-player-controls', context);
+}
+
+// Return the elements
+minplayer.controller["default"].prototype.getElements = function() {
+ var elements = minplayer.controller.base.prototype.getElements.call(this);
+ var timer = jQuery(".media-player-timer", this.display);
+ return jQuery.extend(elements, {
+ play: jQuery(".media-player-play", this.display),
+ pause: jQuery(".media-player-pause", this.display),
+ fullscreen: jQuery(".media-player-fullscreen", this.display),
+ seek: jQuery(".media-player-seek", this.display),
+ progress: jQuery(".media-player-progress", this.display),
+ volume: jQuery(".media-player-volume-slider", this.display),
+ timer:timer,
+ duration:timer
+ });
+};
diff --git a/core/modules/file/player/templates/default/js/minplayer.default.js b/core/modules/file/player/templates/default/js/minplayer.default.js
new file mode 100644
index 0000000..a46af70
--- /dev/null
+++ b/core/modules/file/player/templates/default/js/minplayer.default.js
@@ -0,0 +1,60 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+// Default player.
+minplayer["default"] = function(context, options) {
+
+ // Derive from minplayer.
+ minplayer.call(this, context, options);
+};
+
+/**
+ * Define this template prototype.
+ */
+minplayer["default"].prototype = new minplayer();
+minplayer["default"].prototype.constructor = minplayer["default"];
+
+/**
+ * Return the display for this plugin.
+ */
+minplayer["default"].prototype.getDisplay = function(context, options) {
+
+ // Convert the context to jQuery object.
+ context = jQuery(context);
+
+ // If the tag is video or audio, then build out the player.
+ var tag = context.get(0).tagName.toLowerCase();
+ if (tag == 'video' || tag == 'audio') {
+
+ // Build out the player provided the base tag.
+ context = context.attr({
+ 'id': options.id + '-player',
+ 'class': 'media-player-media'
+ })
+ .wrap(jQuery(document.createElement('div')).attr({
+ 'class': 'media-player-display'
+ })).parent('.media-player-display')
+ .wrap(jQuery(document.createElement('div')).attr({
+ 'id': options.id,
+ 'class': 'media-player'
+ })).parent('.media-player');
+
+ // Mark a flag that says this display needs to be built.
+ context.build = true;
+ }
+
+ return context;
+}
+
+// Get the elements for this player.
+minplayer["default"].prototype.getElements = function() {
+ var elements = minplayer.prototype.getElements.call(this);
+
+ // Return the jQuery elements.
+ return jQuery.extend(elements, {
+ player:this.display,
+ display:jQuery(".media-player-display", this.display),
+ media:jQuery("#" + this.options.id + "-player", this.display),
+ error:jQuery('.media-player-error', this.display)
+ });
+};
diff --git a/core/modules/file/player/templates/default/js/minplayer.playLoader.default.js b/core/modules/file/player/templates/default/js/minplayer.playLoader.default.js
new file mode 100644
index 0000000..facf2ec
--- /dev/null
+++ b/core/modules/file/player/templates/default/js/minplayer.playLoader.default.js
@@ -0,0 +1,46 @@
+/** The minplayer namespace. */
+var minplayer = minplayer || {};
+
+// Define the busy object.
+minplayer.playLoader = minplayer.playLoader || {};
+
+// constructor.
+minplayer.playLoader["default"] = function(context, options) {
+
+ // Derive from busy.base
+ minplayer.playLoader.base.call(this, context, options);
+};
+
+// Define the prototype for all controllers.
+minplayer.playLoader["default"].prototype = new minplayer.playLoader.base();
+minplayer.playLoader["default"].prototype.constructor = minplayer.playLoader["default"];
+
+/**
+ * Return the display for this plugin.
+ */
+minplayer.playLoader["default"].prototype.getDisplay = function(context, options) {
+
+ // See if we need to build out the controller.
+ if (context.build) {
+
+ // Prepend the playloader template.
+ context.prepend('\
+ ');
+ }
+
+ return jQuery('.media-player-play-loader', context);
+}
+
+// Return the elements
+minplayer.playLoader["default"].prototype.getElements = function() {
+ var elements = minplayer.playLoader.base.prototype.getElements.call(this);
+ return jQuery.extend(elements, {
+ busy:jQuery(".media-player-loader", this.display),
+ bigPlay:jQuery(".media-player-big-play", this.display),
+ preview:jQuery(".media-player-preview", this.display)
+ });
+};
diff --git a/core/modules/file/player/templates/default/media_player_default.tpl.php b/core/modules/file/player/templates/default/media_player_default.tpl.php
new file mode 100644
index 0000000..ac8e226
--- /dev/null
+++ b/core/modules/file/player/templates/default/media_player_default.tpl.php
@@ -0,0 +1,32 @@
+
\ No newline at end of file
diff --git a/core/modules/file/player/tools/README.md b/core/modules/file/player/tools/README.md
new file mode 100644
index 0000000..cca552e
--- /dev/null
+++ b/core/modules/file/player/tools/README.md
@@ -0,0 +1,5 @@
+This is a tools folder used to run the makefile. You can easily get all the
+necessary tools by navigating to the player folder within Terminal, and then
+type the following command.
+
+ sudo make -B tools