Changeset 29272
- Timestamp:
- 07/22/2014 09:48:41 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/mce-view.js
r29202 r29272 505 505 this.shortcode = options.shortcode; 506 506 507 _.bindAll( this, 'setIframes', 'setNodes', 'fetch', ' pausePlayers' );507 _.bindAll( this, 'setIframes', 'setNodes', 'fetch', 'stopPlayers' ); 508 508 $( this ).on( 'ready', this.setNodes ); 509 509 510 $( document ).on( 'media:edit', this. pausePlayers );510 $( document ).on( 'media:edit', this.stopPlayers ); 511 511 512 512 this.fetch(); 513 513 514 514 this.getEditors( function( editor ) { 515 editor.on( 'hide', self. pausePlayers );515 editor.on( 'hide', self.stopPlayers ); 516 516 }); 517 517 }, … … 554 554 }, 555 555 556 pausePlayers: function() { 556 stopPlayers: function( remove ) { 557 var rem = remove === 'remove'; 558 557 559 this.getNodes( function( editor, node, content ) { 558 560 var p, win, … … 560 562 561 563 if ( iframe && ( win = iframe.contentWindow ) && win.mejs ) { 562 for ( p in win.mejs.players ) { 563 win.mejs.players[p].pause(); 564 } 564 // Sometimes ME.js may show a "Download File" placeholder and player.remove() doesn't exist there. 565 try { 566 for ( p in win.mejs.players ) { 567 win.mejs.players[p].pause(); 568 569 if ( rem ) { 570 win.mejs.players[p].remove(); 571 } 572 } 573 } catch( er ) {} 565 574 } 566 575 }); 567 576 }, 568 577 569 unsetPlayers: function() {570 this.getNodes( function( editor, node, content ) {571 var p, win,572 iframe = $( 'iframe.wpview-sandbox', content ).get(0);573 574 if ( iframe && ( win = iframe.contentWindow ) && win.mejs ) {575 for ( p in win.mejs.players ) {576 win.mejs.players[p].remove();577 }578 }579 });580 },581 582 578 unbind: function() { 583 this.pausePlayers(); 584 this.unsetPlayers(); 579 this.stopPlayers( 'remove' ); 585 580 } 586 581 },
Note: See TracChangeset
for help on using the changeset viewer.