]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/mediaelement/wp-playlist.js
WordPress 4.0
[autoinstalls/wordpress.git] / wp-includes / js / mediaelement / wp-playlist.js
index ced70c6238b989c76014fbe71e619998f26e4716..90839a5da66bf906b8fbfcd7d07b6a94eb5e825c 100644 (file)
@@ -7,8 +7,7 @@
                initialize : function (options) {
                        this.index = 0;
                        this.settings = {};
                initialize : function (options) {
                        this.index = 0;
                        this.settings = {};
-                       this.compatMode = $( 'body' ).hasClass( 'wp-admin' ) && $( '#content_ifr' ).length;
-                       this.data = options.metadata || $.parseJSON( this.$('script').html() );
+                       this.data = options.metadata || $.parseJSON( this.$('script.wp-playlist-script').html() );
                        this.playerNode = this.$( this.data.type );
 
                        this.tracks = new Backbone.Collection( this.data.tracks );
                        this.playerNode = this.$( this.data.type );
 
                        this.tracks = new Backbone.Collection( this.data.tracks );
                                this.renderTracks();
                        }
 
                                this.renderTracks();
                        }
 
-                       if ( this.isCompatibleSrc() ) {
-                               this.playerNode.attr( 'src', this.current.get( 'src' ) );
-                       }
+                       this.playerNode.attr( 'src', this.current.get( 'src' ) );
 
                        _.bindAll( this, 'bindPlayer', 'bindResetPlayer', 'setPlayer', 'ended', 'clickTrack' );
 
                        if ( ! _.isUndefined( window._wpmejsSettings ) ) {
 
                        _.bindAll( this, 'bindPlayer', 'bindResetPlayer', 'setPlayer', 'ended', 'clickTrack' );
 
                        if ( ! _.isUndefined( window._wpmejsSettings ) ) {
-                               this.settings.pluginPath = _wpmejsSettings.pluginPath;
+                               this.settings = _wpmejsSettings;
                        }
                        this.settings.success = this.bindPlayer;
                        this.setPlayer();
                        }
                        this.settings.success = this.bindPlayer;
                        this.setPlayer();
 
                bindResetPlayer : function (mejs) {
                        this.bindPlayer( mejs );
 
                bindResetPlayer : function (mejs) {
                        this.bindPlayer( mejs );
-                       if ( this.isCompatibleSrc() ) {
-                               this.playCurrentSrc();
-                       }
-               },
-
-               isCompatibleSrc: function () {
-                       var testNode;
-
-                       if ( this.compatMode ) {
-                               testNode = $( '<span><source type="' + this.current.get( 'type' ) + '" /></span>' );
-
-                               if ( ! wp.media.mixin.isCompatible( testNode ) ) {
-                                       this.playerNode.removeAttr( 'src' );
-                                       this.playerNode.removeAttr( 'poster' );
-                                       return;
-                               }
-                       }
-
-                       return true;
+                       this.playCurrentSrc();
                },
 
                setPlayer: function (force) {
                },
 
                setPlayer: function (force) {
@@ -76,9 +55,7 @@
                        }
 
                        if (force) {
                        }
 
                        if (force) {
-                               if ( this.isCompatibleSrc() ) {
-                                       this.playerNode.attr( 'src', this.current.get( 'src' ) );
-                               }
+                               this.playerNode.attr( 'src', this.current.get( 'src' ) );
                                this.settings.success = this.bindResetPlayer;
                        }
 
                                this.settings.success = this.bindResetPlayer;
                        }
 
                                this.next();
                        } else {
                                this.index = 0;
                                this.next();
                        } else {
                                this.index = 0;
-                               this.current = this.tracks.at( this.index );
-                               this.loadCurrent();
+                               this.setCurrent();
                        }
                },
 
                        }
                },
 
 
                        if ( last !== current ) {
                                this.setPlayer( true );
 
                        if ( last !== current ) {
                                this.setPlayer( true );
-                       } else if ( this.isCompatibleSrc() ) {
+                       } else {
                                this.playerNode.attr( 'src', this.current.get( 'src' ) );
                                this.playCurrentSrc();
                        }
                                this.playerNode.attr( 'src', this.current.get( 'src' ) );
                                this.playCurrentSrc();
                        }
        });
 
     $(document).ready(function () {
        });
 
     $(document).ready(function () {
-               if ( ! $( 'body' ).hasClass( 'wp-admin' ) || $( 'body' ).hasClass( 'about-php' ) ) {
-                       $('.wp-playlist').each(function () {
-                               return new WPPlaylistView({ el: this });
-                       });
-               }
+               $('.wp-playlist').each( function() {
+                       return new WPPlaylistView({ el: this });
+               } );
     });
 
        window.WPPlaylistView = WPPlaylistView;
     });
 
        window.WPPlaylistView = WPPlaylistView;