wp/wp-includes/js/mediaelement/wp-playlist.js
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
equal deleted inserted replaced
8:c7c34916027a 9:177826044cd9
     4 	'use strict';
     4 	'use strict';
     5 
     5 
     6 	/** @namespace wp */
     6 	/** @namespace wp */
     7 	window.wp = window.wp || {};
     7 	window.wp = window.wp || {};
     8 
     8 
     9 	var WPPlaylistView = Backbone.View.extend({
     9 	var WPPlaylistView = Backbone.View.extend(/** @lends WPPlaylistView.prototype */{
       
    10 		/**
       
    11 		 * @constructs
       
    12 		 *
       
    13 		 * @param {Object} options          The options to create this playlist view with.
       
    14 		 * @param {Object} options.metadata The metadata
       
    15 		 */
    10 		initialize : function (options) {
    16 		initialize : function (options) {
    11 			this.index = 0;
    17 			this.index = 0;
    12 			this.settings = {};
    18 			this.settings = {};
    13 			this.data = options.metadata || $.parseJSON( this.$('script.wp-playlist-script').html() );
    19 			this.data = options.metadata || $.parseJSON( this.$('script.wp-playlist-script').html() );
    14 			this.playerNode = this.$( this.data.type );
    20 			this.playerNode = this.$( this.data.type );
    60 			if (force) {
    66 			if (force) {
    61 				this.playerNode.attr( 'src', this.current.get( 'src' ) );
    67 				this.playerNode.attr( 'src', this.current.get( 'src' ) );
    62 				this.settings.success = this.bindResetPlayer;
    68 				this.settings.success = this.bindResetPlayer;
    63 			}
    69 			}
    64 
    70 
    65 			/**
    71 			// This is also our bridge to the outside world.
    66 			 * This is also our bridge to the outside world
       
    67 			 */
       
    68 			this.player = new MediaElementPlayer( this.playerNode.get(0), this.settings );
    72 			this.player = new MediaElementPlayer( this.playerNode.get(0), this.settings );
    69 		},
    73 		},
    70 
    74 
    71 		playCurrentSrc : function () {
    75 		playCurrentSrc : function () {
    72 			this.renderCurrent();
    76 			this.renderCurrent();