Changeset 28364
- Timestamp:
- 05/11/2014 02:06:36 AM (11 years ago)
- Location:
- trunk/src/wp-includes/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/mce-view.js
r28358 r28364 372 372 frame, data, callback; 373 373 374 wp.media.mixin.pauseAllPlayers();374 $( document ).trigger( 'media:edit' ); 375 375 376 376 data = window.decodeURIComponent( $( node ).attr('data-wpview-text') ); … … 408 408 this.players = []; 409 409 this.shortcode = options.shortcode; 410 _.bindAll( this, 'setPlayer' ); 411 $(this).on( 'ready', this.setPlayer ); 410 _.bindAll( this, 'setPlayer', 'pausePlayers' ); 411 $( this ).on( 'ready', this.setPlayer ); 412 $( 'body' ).on( 'click', '.wp-switch-editor', this.pausePlayers ); 413 $( document ).on( 'media:edit', this.pausePlayers ); 412 414 }, 413 415 … … 525 527 this.attachments = []; 526 528 this.shortcode = options.shortcode; 529 530 $( 'body' ).on( 'click', '.wp-switch-editor', this.pausePlayers ); 531 $( document ).on( 'media:edit', this.pausePlayers ); 532 527 533 this.fetch(); 528 534 }, … … 688 694 unbind: function() { 689 695 var self = this; 690 this.pauseAllPlayers();691 696 _.each( this.players, function ( player ) { 697 player.pause(); 692 698 self.removePlayer( player ); 693 699 } ); -
trunk/src/wp-includes/js/media-audiovideo.js
r28358 r28364 25 25 } 26 26 } 27 }, 28 29 /** 30 * Pauses the current object's instances of MediaElementPlayer 31 */ 32 pausePlayers: function() { 33 _.each( this.players, function (player) { 34 player.pause(); 35 } ); 27 36 }, 28 37 … … 169 178 unsetPlayers : function() { 170 179 if ( this.players && this.players.length ) { 171 wp.media.mixin.pauseAllPlayers();172 180 _.each( this.players, function (player) { 181 player.pause(); 173 182 wp.media.mixin.removePlayer( player ); 174 183 } ); … … 912 921 function init() { 913 922 $(document.body) 914 .on( 'click', '.wp-switch-editor', wp.media.mixin.pauseAllPlayers )915 923 .on( 'click', '.add-media-source', function( e ) { 916 924 media.frame.lastMime = $( e.currentTarget ).data( 'mime' );
Note: See TracChangeset
for help on using the changeset viewer.