<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[27411] trunk/src/wp-includes: Add TinyMCE placeholders for `audio` and `video` shortcodes.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/27411">27411</a></dd>
<dt>Author</dt> <dd>wonderboymusic</dd>
<dt>Date</dt> <dd>2014-03-05 15:06:00 +0000 (Wed, 05 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add TinyMCE placeholders for `audio` and `video` shortcodes.

* Add `wp.media.mixin`.
* Add `wp.media.audio` and `wp.media.video`.
* Add `wp.media.model.PostAudio` and `wp.media.model.PostVideo`
* Add `wp.media.controller.AudioDetails` and `wp.media.controller.VideoDetails`.
* Add `wp.media.controller.ReplaceAudio` and `wp.media.controller.ReplaceVideo`.
* Add `wp.media.view.MediaFrame.AudioDetails` and `wp.media.view.MediaFrame.VideoDetails`.
* Add `wp.media.view.AudioDetails` and `wp.media.view.VideoDetails`.
* Update the `wpgallery` TinyMCE plugin.
* Display audio and video players in the media modal when shortcode is clicked.
* Provide a UI to edit shortcode attributes in the media modal.
* Provide a UI to replace the `src` media file in an `audio` or `video` shortcode.

See <a href="http://core.trac.wordpress.org/ticket/27016">#27016</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludescssmediaviewscss">trunk/src/wp-includes/css/media-views.css</a></li>
<li><a href="#trunksrcwpincludesjsmediaeditorjs">trunk/src/wp-includes/js/media-editor.js</a></li>
<li><a href="#trunksrcwpincludesjsmediamodelsjs">trunk/src/wp-includes/js/media-models.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaviewsjs">trunk/src/wp-includes/js/media-views.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaelementwpmediaelementcss">trunk/src/wp-includes/js/mediaelement/wp-mediaelement.css</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpgallerypluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js</a></li>
<li><a href="#trunksrcwpincludesmediatemplatephp">trunk/src/wp-includes/media-template.php</a></li>
<li><a href="#trunksrcwpincludesmediaphp">trunk/src/wp-includes/media.php</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludescssmediaviewscss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/css/media-views.css (27410 => 27411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/css/media-views.css        2014-03-05 12:58:27 UTC (rev 27410)
+++ trunk/src/wp-includes/css/media-views.css   2014-03-05 15:06:00 UTC (rev 27411)
</span><span class="lines">@@ -1460,7 +1460,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .embed-link-settings,
</span><del>-.embed-image-settings {
</del><ins>+.embed-media-settings {
</ins><span class="cx">   position: absolute;
</span><span class="cx">  top: 60px;
</span><span class="cx">  left: 0;
</span><span class="lines">@@ -1470,7 +1470,7 @@
</span><span class="cx">  overflow: auto;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.image-details .embed-image-settings {
</del><ins>+.image-details .embed-media-settings {
</ins><span class="cx">   top: 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1523,7 +1523,7 @@
</span><span class="cx">  margin: 2px 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.media-embed .setting input,
</del><ins>+.media-embed .setting input[type="text"],
</ins><span class="cx"> .media-embed .setting textarea {
</span><span class="cx">  display: block;
</span><span class="cx">  width: 100%;
</span><span class="lines">@@ -1872,7 +1872,7 @@
</span><span class="cx"> 
</span><span class="cx">  /* Image From Link */
</span><span class="cx">  .embed-link-settings,
</span><del>-       .embed-image-settings {
</del><ins>+        .embed-media-settings {
</ins><span class="cx">           padding-bottom: 52px;
</span><span class="cx">  }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaeditorjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-editor.js (27410 => 27411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-editor.js 2014-03-05 12:58:27 UTC (rev 27410)
+++ trunk/src/wp-includes/js/media-editor.js    2014-03-05 15:06:00 UTC (rev 27411)
</span><span class="lines">@@ -274,30 +274,33 @@
</span><span class="cx">          }
</span><span class="cx">  };
</span><span class="cx"> 
</span><ins>+       wp.media.mixin = {
+               /**
+                * A helper function to avoid truthy and falsey values being
+                *   passed as an input that expects booleans. If key is undefined in the map,
+                *   but has a default value, set it.
+                *
+                * @param {object} attrs Map of props from a shortcode or settings.
+                * @param {string} key The key within the passed map to check for a value.
+                * @returns {mixed|undefined} The original or coerced value of key within attrs
+                */
+               coerce: function ( attrs, key ) {
+                       if ( _.isUndefined( attrs[ key ] ) && ! _.isUndefined( this.defaults[ key ] ) ) {
+                               attrs[ key ] = this.defaults[ key ];
+                       } else if ( 'true' === attrs[ key ] ) {
+                               attrs[ key ] = true;
+                       } else if ( 'false' === attrs[ key ] ) {
+                               attrs[ key ] = false;
+                       }
+                       return attrs[ key ];
+               }
+       };
+
</ins><span class="cx">   wp.media.collection = function(attributes) {
</span><span class="cx">          var collections = {};
</span><span class="cx"> 
</span><del>-               return _.extend( attributes, {
</del><ins>+                return _.extend( attributes, wp.media.mixin, {
</ins><span class="cx">                   /**
</span><del>-                        * A helper function to avoid truthy and falsey values being
-                        *   passed as an input that expects booleans. If key is undefined in the map,
-                        *   but has a default value, set it.
-                        *
-                        * @param {object} attrs Map of props from a shortcode or settings.
-                        * @param {string} key The key within the passed map to check for a value.
-                        * @returns {mixed|undefined} The original or coerced value of key within attrs
-                        */
-                       coerce: function ( attrs, key ) {
-                               if ( _.isUndefined( attrs[ key ] ) && ! _.isUndefined( this.defaults[ key ] ) ) {
-                                       attrs[ key ] = this.defaults[ key ];
-                               } else if ( 'true' === attrs[ key ] ) {
-                                       attrs[ key ] = true;
-                               } else if ( 'false' === attrs[ key ] ) {
-                                       attrs[ key ] = false;
-                               }
-                               return attrs[ key ];
-                       },
-                       /**
</del><span class="cx">                    * Retrieve attachments based on the properties of the passed shortcode
</span><span class="cx">                   *
</span><span class="cx">                   * @global wp.media.query
</span><span class="lines">@@ -536,7 +539,7 @@
</span><span class="cx">          }
</span><span class="cx">  });
</span><span class="cx"> 
</span><del>-       wp.media['video-playlist'] = new wp.media.collection( {
</del><ins>+        wp.media['video-playlist'] = new wp.media.collection({
</ins><span class="cx">           tag: 'video-playlist',
</span><span class="cx">          type : 'video',
</span><span class="cx">          editTitle : wp.media.view.l10n.editVideoPlaylistTitle,
</span><span class="lines">@@ -547,8 +550,90 @@
</span><span class="cx">                  tracknumbers: false,
</span><span class="cx">                  images: true
</span><span class="cx">          }
</span><del>-       } );
</del><ins>+        });
</ins><span class="cx"> 
</span><ins>+       wp.media.audio = _.extend({
+               defaults : {
+                       id : wp.media.view.settings.post.id,
+                       src      : '',
+                       loop     : false,
+                       autoplay : false,
+                       preload  : 'none'
+               },
+
+               edit : function (data) {
+                       var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
+                       frame = wp.media({
+                               frame: 'audio',
+                               state: 'audio-details',
+                               metadata: _.defaults(
+                                       shortcode.attrs.named,
+                                       wp.media.audio.defaults
+                               )
+                       });
+
+                       return frame;
+               },
+
+               shortcode : function (shortcode) {
+                       var self = this;
+
+                       _.each( wp.media.audio.defaults, function( value, key ) {
+                               shortcode[ key ] = self.coerce( shortcode, key );
+
+                               if ( value === shortcode[ key ] ) {
+                                       delete shortcode[ key ];
+                               }
+                       });
+
+                       return wp.shortcode.string({
+                               tag:     'audio',
+                               attrs:   shortcode
+                       });
+               }
+       }, wp.media.mixin);
+
+       wp.media.video = _.extend({
+               defaults : {
+                       id : wp.media.view.settings.post.id,
+                       src : '',
+                       poster : '',
+                       loop : false,
+                       autoplay : false,
+                       preload : 'metadata'
+               },
+
+               edit : function (data) {
+                       var frame, shortcode = wp.shortcode.next( 'video', data ).shortcode;
+                       frame = wp.media({
+                               frame: 'video',
+                               state: 'video-details',
+                               metadata: _.defaults(
+                                       shortcode.attrs.named,
+                                       wp.media.video.defaults
+                               )
+                       });
+
+                       return frame;
+               },
+
+               shortcode : function (shortcode) {
+                       var self = this;
+                       _.each( wp.media.video.defaults, function( value, key ) {
+                               shortcode[ key ] = self.coerce( shortcode, key );
+
+                               if ( value === shortcode[ key ] ) {
+                                       delete shortcode[ key ];
+                               }
+                       });
+
+                       return wp.shortcode.string({
+                               tag:     'video',
+                               attrs:   shortcode
+                       });
+               }
+       }, wp.media.mixin);
+
</ins><span class="cx">   /**
</span><span class="cx">   * wp.media.featuredImage
</span><span class="cx">   * @namespace
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediamodelsjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-models.js (27410 => 27411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-models.js 2014-03-05 12:58:27 UTC (rev 27410)
+++ trunk/src/wp-includes/js/media-models.js    2014-03-05 15:06:00 UTC (rev 27411)
</span><span class="lines">@@ -32,6 +32,10 @@
</span><span class="cx">                  frame = new MediaFrame.Post( attributes );
</span><span class="cx">          } else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) {
</span><span class="cx">                  frame = new MediaFrame.ImageDetails( attributes );
</span><ins>+               } else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) {
+                       frame = new MediaFrame.AudioDetails( attributes );
+               } else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) {
+                       frame = new MediaFrame.VideoDetails( attributes );
</ins><span class="cx">           }
</span><span class="cx"> 
</span><span class="cx">          delete attributes.frame;
</span><span class="lines">@@ -448,6 +452,64 @@
</span><span class="cx">  });
</span><span class="cx"> 
</span><span class="cx">  /**
</span><ins>+        * wp.media.model.PostAudio
+        *
+        * @constructor
+        * @augments Backbone.Model
+        **/
+       PostAudio = media.model.PostAudio = Backbone.Model.extend({
+               initialize: function() {
+                       this.attachment = false;
+               },
+
+               changeAttachment: function( attachment, props ) {
+                       var self = this;
+
+                       this.attachment = attachment;
+                       this.extension = attachment.get('filename' ).split('.').pop();
+
+                       if ( _.contains( wp.media.view.settings.embedExts, this.extension ) ) {
+                               this.set( this.extension, attachment.get( 'url' ) );
+                       } else {
+                               this.set( this.extension, '' );
+                       }
+
+                       _.each( _.without( wp.media.view.settings.embedExts, this.extension ), function (ext) {
+                               self.set( ext, '' );
+                       } );
+               }
+       });
+
+       /**
+        * wp.media.model.PostVideo
+        *
+        * @constructor
+        * @augments Backbone.Model
+        **/
+       PostVideo = media.model.PostVideo = Backbone.Model.extend({
+               initialize: function() {
+                       this.attachment = false;
+               },
+
+               changeAttachment: function( attachment, props ) {
+                       var self = this;
+
+                       this.attachment = attachment;
+                       this.extension = attachment.get('filename' ).split('.').pop();
+
+                       if ( _.contains( wp.media.view.settings.embedExts, this.extension ) ) {
+                               this.set( this.extension, attachment.get( 'url' ) );
+                       } else {
+                               this.set( this.extension, '' );
+                       }
+
+                       _.each( _.without( wp.media.view.settings.embedExts, this.extension ), function (ext) {
+                               self.set( ext, '' );
+                       } );
+               }
+       });
+
+       /**
</ins><span class="cx">    * wp.media.model.Attachments
</span><span class="cx">   *
</span><span class="cx">   * @constructor
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-views.js (27410 => 27411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-views.js  2014-03-05 12:58:27 UTC (rev 27410)
+++ trunk/src/wp-includes/js/media-views.js     2014-03-05 15:06:00 UTC (rev 27411)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /* global _wpMediaViewsL10n, confirm, getUserSetting, setUserSetting */
</span><del>-(function($){
</del><ins>+(function($, _){
</ins><span class="cx">   var media = wp.media, l10n;
</span><span class="cx"> 
</span><span class="cx">  // Link any localized strings.
</span><span class="lines">@@ -760,6 +760,58 @@
</span><span class="cx">  });
</span><span class="cx"> 
</span><span class="cx">  /**
</span><ins>+        * wp.media.controller.AudioDetails
+        *
+        * @constructor
+        * @augments wp.media.controller.State
+        * @augments Backbone.Model
+        */
+       media.controller.AudioDetails = media.controller.State.extend({
+               defaults: _.defaults({
+                       id: 'audio-details',
+                       toolbar: 'audio-details',
+                       title: l10n.audioDetailsTitle,
+                       content: 'audio-details',
+                       menu: 'audio-details',
+                       router: false,
+                       attachment: false,
+                       priority: 60,
+                       editing: false
+               }, media.controller.Library.prototype.defaults ),
+
+               initialize: function( options ) {
+                       this.audio = options.audio;
+                       media.controller.State.prototype.initialize.apply( this, arguments );
+               }
+       });
+
+       /**
+        * wp.media.controller.VideoDetails
+        *
+        * @constructor
+        * @augments wp.media.controller.State
+        * @augments Backbone.Model
+        */
+       media.controller.VideoDetails = media.controller.State.extend({
+               defaults: _.defaults({
+                       id: 'video-details',
+                       toolbar: 'video-details',
+                       title: l10n.videoDetailsTitle,
+                       content: 'video-details',
+                       menu: 'video-details',
+                       router: false,
+                       attachment: false,
+                       priority: 60,
+                       editing: false
+               }, media.controller.Library.prototype.defaults ),
+
+               initialize: function( options ) {
+                       this.video = options.video;
+                       media.controller.State.prototype.initialize.apply( this, arguments );
+               }
+       });
+
+       /**
</ins><span class="cx">    * wp.media.controller.CollectionEdit
</span><span class="cx">   *
</span><span class="cx">   * @constructor
</span><span class="lines">@@ -1068,6 +1120,142 @@
</span><span class="cx">  });
</span><span class="cx"> 
</span><span class="cx">  /**
</span><ins>+        * wp.media.controller.ReplaceVideo
+        *
+        * Replace a selected single video
+        *
+        * @constructor
+        * @augments wp.media.controller.Library
+        * @augments wp.media.controller.State
+        * @augments Backbone.Model
+        */
+       media.controller.ReplaceVideo = media.controller.Library.extend({
+               defaults: _.defaults({
+                       id:         'replace-video',
+                       filterable: 'uploaded',
+                       multiple:   false,
+                       toolbar:    'replace',
+                       title:      l10n.replaceVideoTitle,
+                       priority:   60,
+                       syncSelection: false
+               }, media.controller.Library.prototype.defaults ),
+
+               initialize: function( options ) {
+                       var library, comparator;
+
+                       this.video = options.video;
+                       // If we haven't been provided a `library`, create a `Selection`.
+                       if ( ! this.get('library') ) {
+                               this.set( 'library', media.query({ type: 'video' }) );
+                       }
+
+                       media.controller.Library.prototype.initialize.apply( this, arguments );
+
+                       library    = this.get('library');
+                       comparator = library.comparator;
+
+                       // Overload the library's comparator to push items that are not in
+                       // the mirrored query to the front of the aggregate collection.
+                       library.comparator = function( a, b ) {
+                               var aInQuery = !! this.mirroring.get( a.cid ),
+                                       bInQuery = !! this.mirroring.get( b.cid );
+
+                               if ( ! aInQuery && bInQuery ) {
+                                       return -1;
+                               } else if ( aInQuery && ! bInQuery ) {
+                                       return 1;
+                               } else {
+                                       return comparator.apply( this, arguments );
+                               }
+                       };
+
+                       // Add all items in the selection to the library, so any featured
+                       // images that are not initially loaded still appear.
+                       library.observe( this.get('selection') );
+               },
+
+               activate: function() {
+                       this.updateSelection();
+                       media.controller.Library.prototype.activate.apply( this, arguments );
+               },
+
+               updateSelection: function() {
+                       var selection = this.get('selection'),
+                               attachment = this.video.attachment;
+
+                       selection.reset( attachment ? [ attachment ] : [] );
+               }
+       });
+
+       /**
+        * wp.media.controller.ReplaceAudio
+        *
+        * Replace a selected single audio file
+        *
+        * @constructor
+        * @augments wp.media.controller.Library
+        * @augments wp.media.controller.State
+        * @augments Backbone.Model
+        */
+       media.controller.ReplaceAudio = media.controller.Library.extend({
+               defaults: _.defaults({
+                       id:         'replace-audio',
+                       filterable: 'uploaded',
+                       multiple:   false,
+                       toolbar:    'replace',
+                       title:      l10n.replaceAudioTitle,
+                       priority:   60,
+                       syncSelection: false
+               }, media.controller.Library.prototype.defaults ),
+
+               initialize: function( options ) {
+                       var library, comparator;
+
+                       this.audio = options.audio;
+                       // If we haven't been provided a `library`, create a `Selection`.
+                       if ( ! this.get('library') ) {
+                               this.set( 'library', media.query({ type: 'audio' }) );
+                       }
+
+                       media.controller.Library.prototype.initialize.apply( this, arguments );
+
+                       library    = this.get('library');
+                       comparator = library.comparator;
+
+                       // Overload the library's comparator to push items that are not in
+                       // the mirrored query to the front of the aggregate collection.
+                       library.comparator = function( a, b ) {
+                               var aInQuery = !! this.mirroring.get( a.cid ),
+                                       bInQuery = !! this.mirroring.get( b.cid );
+
+                               if ( ! aInQuery && bInQuery ) {
+                                       return -1;
+                               } else if ( aInQuery && ! bInQuery ) {
+                                       return 1;
+                               } else {
+                                       return comparator.apply( this, arguments );
+                               }
+                       };
+
+                       // Add all items in the selection to the library, so any featured
+                       // images that are not initially loaded still appear.
+                       library.observe( this.get('selection') );
+               },
+
+               activate: function() {
+                       this.updateSelection();
+                       media.controller.Library.prototype.activate.apply( this, arguments );
+               },
+
+               updateSelection: function() {
+                       var selection = this.get('selection'),
+                               attachment = this.audio.attachment;
+
+                       selection.reset( attachment ? [ attachment ] : [] );
+               }
+       });
+
+       /**
</ins><span class="cx">    * wp.media.controller.Embed
</span><span class="cx">   *
</span><span class="cx">   * @constructor
</span><span class="lines">@@ -2461,7 +2649,290 @@
</span><span class="cx"> 
</span><span class="cx">  });
</span><span class="cx"> 
</span><ins>+       media.view.MediaFrame.AudioDetails = media.view.MediaFrame.Select.extend({
+               defaults: {
+                       id:      'audio',
+                       url:     '',
+                       menu:    'audio-details',
+                       content: 'audio-details',
+                       toolbar: 'audio-details',
+                       type:    'link',
+                       title:    l10n.audioDetailsTitle,
+                       priority: 120
+               },
</ins><span class="cx"> 
</span><ins>+               initialize: function( options ) {
+                       this.audio = new media.model.PostAudio( options.metadata );
+                       this.options.selection = new media.model.Selection( this.audio.attachment, { multiple: false } );
+                       media.view.MediaFrame.Select.prototype.initialize.apply( this, arguments );
+               },
+
+               bindHandlers: function() {
+                       media.view.MediaFrame.Select.prototype.bindHandlers.apply( this, arguments );
+                       this.on( 'menu:create:audio-details', this.createMenu, this );
+                       this.on( 'content:render:audio-details', this.renderAudioDetailsContent, this );
+                       this.on( 'menu:render:audio-details', this.renderMenu, this );
+                       this.on( 'toolbar:render:audio-details', this.renderAudioDetailsToolbar, this );
+                       // override the select toolbar
+                       this.on( 'toolbar:render:replace', this.renderReplaceAudioToolbar, this );
+               },
+
+               createStates: function() {
+                       this.states.add([
+                               new media.controller.AudioDetails({
+                                       audio: this.audio,
+                                       editable: false,
+                                       menu: 'audio-details'
+                               }),
+                               new media.controller.ReplaceAudio({
+                                       id: 'replace-audio',
+                                       library:   media.query( { type: 'audio' } ),
+                                       audio: this.audio,
+                                       multiple:  false,
+                                       title:     l10n.audioReplaceTitle,
+                                       menu: 'audio-details',
+                                       toolbar: 'replace',
+                                       priority:  80,
+                                       displaySettings: true
+                               })
+                       ]);
+               },
+
+               renderAudioDetailsContent: function() {
+                       var view = new media.view.AudioDetails({
+                               controller: this,
+                               model: this.state().audio,
+                               attachment: this.state().audio.attachment
+                       }).render();
+
+                       this.content.set( view );
+               },
+
+               renderMenu: function( view ) {
+                       var lastState = this.lastState(),
+                               previous = lastState && lastState.id,
+                               frame = this;
+
+                       view.set({
+                               cancel: {
+                                       text:     l10n.audioDetailsCancel,
+                                       priority: 20,
+                                       click:    function() {
+                                               if ( previous ) {
+                                                       frame.setState( previous );
+                                               } else {
+                                                       frame.close();
+                                               }
+                                       }
+                               },
+                               separateCancel: new media.View({
+                                       className: 'separator',
+                                       priority: 40
+                               })
+                       });
+
+               },
+
+               renderAudioDetailsToolbar: function() {
+                       this.toolbar.set( new media.view.Toolbar({
+                               controller: this,
+                               items: {
+                                       select: {
+                                               style:    'primary',
+                                               text:     l10n.update,
+                                               priority: 80,
+
+                                               click: function() {
+                                                       var controller = this.controller,
+                                                               state = controller.state();
+
+                                                       controller.close();
+
+                                                       // not sure if we want to use wp.media.string.image which will create a shortcode or
+                                                       // perhaps wp.html.string to at least to build the <img />
+                                                       state.trigger( 'update', controller.audio.toJSON() );
+
+                                                       // Restore and reset the default state.
+                                                       controller.setState( controller.options.state );
+                                                       controller.reset();
+                                               }
+                                       }
+                               }
+                       }) );
+               },
+
+               renderReplaceAudioToolbar: function() {
+                       this.toolbar.set( new media.view.Toolbar({
+                               controller: this,
+                               items: {
+                                       replace: {
+                                               style:    'primary',
+                                               text:     l10n.replace,
+                                               priority: 80,
+
+                                               click: function() {
+                                                       var controller = this.controller,
+                                                               state = controller.state(),
+                                                               selection = state.get( 'selection' ),
+                                                               attachment = selection.single();
+
+                                                       controller.audio.changeAttachment( attachment, state.display( attachment ) );
+
+                                                       // not sure if we want to use wp.media.string.image which will create a shortcode or
+                                                       // perhaps wp.html.string to at least to build the <img />
+                                                       state.trigger( 'replace', controller.audio.toJSON() );
+
+                                                       // Restore and reset the default state.
+                                                       controller.setState( controller.options.state );
+                                                       controller.reset();
+                                               }
+                                       }
+                               }
+                       }) );
+               }
+       });
+
+       media.view.MediaFrame.VideoDetails = media.view.MediaFrame.Select.extend({
+               defaults: {
+                       id:      'video',
+                       url:     '',
+                       menu:    'video-details',
+                       content: 'video-details',
+                       toolbar: 'video-details',
+                       type:    'link',
+                       title:    l10n.videoDetailsTitle,
+                       priority: 120
+               },
+
+               initialize: function( options ) {
+                       this.video = new media.model.PostVideo( options.metadata );
+                       this.options.selection = new media.model.Selection( this.video.attachment, { multiple: false } );
+                       media.view.MediaFrame.Select.prototype.initialize.apply( this, arguments );
+               },
+
+               bindHandlers: function() {
+                       media.view.MediaFrame.Select.prototype.bindHandlers.apply( this, arguments );
+                       this.on( 'menu:create:video-details', this.createMenu, this );
+                       this.on( 'content:render:video-details', this.renderVideoDetailsContent, this );
+                       this.on( 'menu:render:video-details', this.renderMenu, this );
+                       this.on( 'toolbar:render:video-details', this.renderVideoDetailsToolbar, this );
+                       // override the select toolbar
+                       this.on( 'toolbar:render:replace', this.renderReplaceVideoToolbar, this );
+               },
+
+               createStates: function() {
+                       this.states.add([
+                               new media.controller.VideoDetails({
+                                       video: this.video,
+                                       editable: false,
+                                       menu: 'video-details'
+                               }),
+                               new media.controller.ReplaceVideo({
+                                       id: 'replace-video',
+                                       library:   media.query( { type: 'video' } ),
+                                       video: this.video,
+                                       multiple:  false,
+                                       title:     l10n.videoReplaceTitle,
+                                       menu: 'video-details',
+                                       toolbar: 'replace',
+                                       priority:  80,
+                                       displaySettings: true
+                               })
+                       ]);
+               },
+
+               renderVideoDetailsContent: function() {
+                       var view = new media.view.VideoDetails({
+                               controller: this,
+                               model: this.state().video,
+                               attachment: this.state().video.attachment
+                       }).render();
+
+                       this.content.set( view );
+               },
+
+               renderMenu: function( view ) {
+                       var lastState = this.lastState(),
+                               previous = lastState && lastState.id,
+                               frame = this;
+
+                       view.set({
+                               cancel: {
+                                       text:     l10n.videoDetailsCancel,
+                                       priority: 20,
+                                       click:    function() {
+                                               if ( previous ) {
+                                                       frame.setState( previous );
+                                               } else {
+                                                       frame.close();
+                                               }
+                                       }
+                               },
+                               separateCancel: new media.View({
+                                       className: 'separator',
+                                       priority: 40
+                               })
+                       });
+
+               },
+
+               renderVideoDetailsToolbar: function() {
+                       this.toolbar.set( new media.view.Toolbar({
+                               controller: this,
+                               items: {
+                                       select: {
+                                               style:    'primary',
+                                               text:     l10n.update,
+                                               priority: 80,
+
+                                               click: function() {
+                                                       var controller = this.controller,
+                                                               state = controller.state();
+
+                                                       controller.close();
+
+                                                       // not sure if we want to use wp.media.string.image which will create a shortcode or
+                                                       // perhaps wp.html.string to at least to build the <img />
+                                                       state.trigger( 'update', controller.video.toJSON() );
+
+                                                       // Restore and reset the default state.
+                                                       controller.setState( controller.options.state );
+                                                       controller.reset();
+                                               }
+                                       }
+                               }
+                       }) );
+               },
+
+               renderReplaceVideoToolbar: function() {
+                       this.toolbar.set( new media.view.Toolbar({
+                               controller: this,
+                               items: {
+                                       replace: {
+                                               style:    'primary',
+                                               text:     l10n.replace,
+                                               priority: 80,
+
+                                               click: function() {
+                                                       var controller = this.controller,
+                                                               state = controller.state(),
+                                                               selection = state.get( 'selection' ),
+                                                               attachment = selection.single();
+
+                                                       controller.video.changeAttachment( attachment, state.display( attachment ) );
+
+                                                       state.trigger( 'replace', controller.video.toJSON() );
+
+                                                       // Restore and reset the default state.
+                                                       controller.setState( controller.options.state );
+                                                       controller.reset();
+                                               }
+                                       }
+                               }
+                       }) );
+               }
+       });
+
</ins><span class="cx">   /**
</span><span class="cx">   * wp.media.view.Modal
</span><span class="cx">   *
</span><span class="lines">@@ -5605,7 +6076,7 @@
</span><span class="cx">   * @augments Backbone.View
</span><span class="cx">   */
</span><span class="cx">  media.view.EmbedImage =  media.view.Settings.AttachmentDisplay.extend({
</span><del>-               className: 'embed-image-settings',
</del><ins>+                className: 'embed-media-settings',
</ins><span class="cx">           template:  media.template('embed-image-settings'),
</span><span class="cx"> 
</span><span class="cx">          initialize: function() {
</span><span class="lines">@@ -5666,4 +6137,131 @@
</span><span class="cx">                  this.$( '.embed-image-settings' ).scrollTop( 0 );
</span><span class="cx">          }
</span><span class="cx">  });
</span><del>-}(jQuery));
</del><ins>+
+       media.view.AudioDetails = media.view.Settings.AttachmentDisplay.extend({
+               className: 'audio-details',
+               template:  media.template('audio-details'),
+
+               initialize: function() {
+                       _.bindAll(this, 'player', 'close');
+
+                       this.listenTo( this.controller, 'close', this.close );
+
+                       // used in AttachmentDisplay.prototype.updateLinkTo
+                       this.options.attachment = this.model.attachment;
+                       media.view.Settings.AttachmentDisplay.prototype.initialize.apply( this, arguments );
+               },
+
+               prepare: function() {
+                       var attachment = false;
+
+                       if ( this.model.attachment ) {
+                               attachment = this.model.attachment.toJSON();
+                       }
+                       return _.defaults({
+                               model: this.model.toJSON(),
+                               attachment: attachment
+                       }, this.options );
+               },
+
+               close : function() {
+                       this.mejs.pause();
+                       this.remove();
+                       delete this.mejs;
+                       delete this.mejsInstance;
+               },
+
+               player : function (mejs) {
+                       this.mejs = mejs;
+               },
+
+               render: function() {
+                       var self = this, settings = {
+                               success : this.player
+                       };
+
+                       if ( ! _.isUndefined( window._wpmejsSettings ) ) {
+                               settings.pluginPath = _wpmejsSettings.pluginPath;
+                       }
+
+                       media.view.Settings.AttachmentDisplay.prototype.render.apply( this, arguments );
+                       setTimeout( function() { self.resetFocus(); }, 10 );
+
+                       this.mejsInstance = new MediaElementPlayer( this.$('audio').get(0), settings );
+
+                       return this;
+               },
+
+               resetFocus: function() {
+                       this.$( '.embed-media-settings' ).scrollTop( 0 );
+               }
+       });
+
+       media.view.VideoDetails = media.view.Settings.AttachmentDisplay.extend({
+               className: 'video-details',
+               template:  media.template('video-details'),
+
+               initialize: function() {
+                       _.bindAll(this, 'player', 'played');
+
+                       this.removable = false;
+                       this.listenTo( this.controller, 'close', this.close );
+
+                       // used in AttachmentDisplay.prototype.updateLinkTo
+                       this.options.attachment = this.model.attachment;
+                       media.view.Settings.AttachmentDisplay.prototype.initialize.apply( this, arguments );
+               },
+
+               prepare: function() {
+                       var attachment = false;
+
+                       if ( this.model.attachment ) {
+                               attachment = this.model.attachment.toJSON();
+                       }
+                       return _.defaults({
+                               model: this.model.toJSON(),
+                               attachment: attachment
+                       }, this.options );
+               },
+
+               close : function() {
+                       if ( this.removable ) {
+                               this.mejs.pause();
+                       }
+                       this.remove();
+                       this.mejs = this.mejsInstance = null;
+               },
+
+               played : function () {
+                       this.removable = true;
+               },
+
+               player : function (mejs) {
+                       this.mejs = mejs;
+                       this.mejs.addEventListener( 'play', this.played );
+               },
+
+               render: function() {
+                       var self = this, settings = {
+                               success : this.player
+                       };
+
+                       if ( ! _.isUndefined( window._wpmejsSettings ) ) {
+                               settings.pluginPath = _wpmejsSettings.pluginPath;
+                       }
+
+                       media.view.Settings.AttachmentDisplay.prototype.render.apply( this, arguments );
+                       setTimeout( function() { self.resetFocus(); }, 10 );
+
+                       if ( ! this.mejsInstance ) {
+                               this.mejsInstance = new MediaElementPlayer( this.$('video').get(0), settings );
+                       }
+
+                       return this;
+               },
+
+               resetFocus: function() {
+                       this.$( '.embed-media-settings' ).scrollTop( 0 );
+               }
+       });
+}(jQuery, _));
</ins></span></pre></div>
<a id="trunksrcwpincludesjsmediaelementwpmediaelementcss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/mediaelement/wp-mediaelement.css (27410 => 27411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/mediaelement/wp-mediaelement.css        2014-03-05 12:58:27 UTC (rev 27410)
+++ trunk/src/wp-includes/js/mediaelement/wp-mediaelement.css   2014-03-05 15:06:00 UTC (rev 27411)
</span><span class="lines">@@ -14,6 +14,27 @@
</span><span class="cx">  width: auto !important;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.audio-details .wp-audio-shortcode {
+       display: inline-block;
+       max-width: 400px;
+}
+
+.video-details .embed-video-settings,
+.audio-details .embed-audio-settings {
+       top: 10px;
+}
+
+.video-details .embed-video-settings .checkbox-setting,
+.audio-details .embed-audio-settings .checkbox-setting {
+       width: 100px;
+       clear: none;
+}
+
+.video-details .wp-video-holder {
+       width: 100%;
+       max-width: 640px;
+}
+
</ins><span class="cx"> .wp-playlist {
</span><span class="cx">  border: 1px solid #ccc;
</span><span class="cx">  padding: 10px;
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpgallerypluginjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js (27410 => 27411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js     2014-03-05 12:58:27 UTC (rev 27410)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js        2014-03-05 15:06:00 UTC (rev 27411)
</span><span class="lines">@@ -64,10 +64,11 @@
</span><span class="cx">                  return;
</span><span class="cx">          }
</span><span class="cx"> 
</span><ins>+               data = window.decodeURIComponent( editor.dom.getAttrib( node, 'data-wp-media' ) );
+
</ins><span class="cx">           // Make sure we've selected a gallery node.
</span><span class="cx">          if ( editor.dom.hasClass( node, 'wp-gallery' ) && wp.media.gallery ) {
</span><span class="cx">                  gallery = wp.media.gallery;
</span><del>-                       data = window.decodeURIComponent( editor.dom.getAttrib( node, 'data-wp-media' ) );
</del><span class="cx">                   frame = gallery.edit( data );
</span><span class="cx"> 
</span><span class="cx">                  frame.state('gallery-edit').on( 'update', function( selection ) {
</span><span class="lines">@@ -76,7 +77,6 @@
</span><span class="cx">                          frame.detach();
</span><span class="cx">                  });
</span><span class="cx">          } else if ( editor.dom.hasClass( node, 'wp-playlist' ) && wp.media.playlist ) {
</span><del>-                       data = window.decodeURIComponent( editor.dom.getAttrib( node, 'data-wp-media' ) );
</del><span class="cx">                   frame = wp.media.playlist.edit( data );
</span><span class="cx"> 
</span><span class="cx">                  frame.state('playlist-edit').on( 'update', function( selection ) {
</span><span class="lines">@@ -85,7 +85,6 @@
</span><span class="cx">                          frame.detach();
</span><span class="cx">                  });
</span><span class="cx">          } else if ( editor.dom.hasClass( node, 'wp-video-playlist' ) && wp.media['video-playlist'] ) {
</span><del>-                       data = window.decodeURIComponent( editor.dom.getAttrib( node, 'data-wp-media' ) );
</del><span class="cx">                   frame = wp.media['video-playlist'].edit( data );
</span><span class="cx"> 
</span><span class="cx">                  frame.state('video-playlist-edit').on( 'update', function( selection ) {
</span><span class="lines">@@ -93,9 +92,23 @@
</span><span class="cx">                          editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
</span><span class="cx">                          frame.detach();
</span><span class="cx">                  });
</span><ins>+               } else if ( editor.dom.hasClass( node, 'wp-video' ) ) {
+                       frame = wp.media.video.edit( data );
+                       frame.state( 'video-details' ).on( 'update replace', function ( selection ) {
+                               var shortcode = wp.media.video.shortcode( selection );
+                               editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
+                       } );
+                       frame.open();
+               } else if ( editor.dom.hasClass( node, 'wp-audio' ) ) {
+                       frame = wp.media.audio.edit( data );
+                       frame.state( 'audio-details' ).on( 'update replace', function ( selection ) {
+                               var shortcode = wp.media.audio.shortcode( selection );
+                               editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
+                       } );
+                       frame.open();
</ins><span class="cx">           } else {
</span><span class="cx">                  // temp
</span><del>-                       window.console && window.console.log( 'Edit AV shortcode ' + window.decodeURIComponent( editor.dom.getAttrib( node, 'data-wp-media' ) ) );
</del><ins>+                        window.console && window.console.log( 'Edit AV shortcode ' + data );
</ins><span class="cx">           }
</span><span class="cx">  }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunksrcwpincludesmediatemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/media-template.php (27410 => 27411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/media-template.php 2014-03-05 12:58:27 UTC (rev 27410)
+++ trunk/src/wp-includes/media-template.php    2014-03-05 15:06:00 UTC (rev 27411)
</span><span class="lines">@@ -555,7 +555,7 @@
</span><span class="cx">  <script type="text/html" id="tmpl-image-details">
</span><span class="cx">          <?php // reusing .media-embed to pick up the styles for now ?>
</span><span class="cx">          <div class="media-embed">
</span><del>-                       <div class="embed-image-settings">
</del><ins>+                        <div class="embed-media-settings">
</ins><span class="cx">                           <div class="thumbnail">
</span><span class="cx">                                  <img src="{{ data.model.url }}" draggable="false" />
</span><span class="cx">                          </div>
</span><span class="lines">@@ -648,6 +648,161 @@
</span><span class="cx">                  </div>
</span><span class="cx">          </div>
</span><span class="cx">  </script>
</span><ins>+
+       <script type="text/html" id="tmpl-audio-details">
+               <?php // reusing .media-embed to pick up the styles for now ?>
+               <# var rendered = false; #>
+               <div class="media-embed">
+                       <div class="embed-media-settings embed-audio-settings">
+                               <# if ( data.model.src ) { #>
+                                       <audio class="wp-audio-shortcode" src="{{{ data.model.src }}}"
+                                               preload="{{{ _.isUndefined( data.model.preload ) ? 'none' : data.model.preload }}}"
+                                               <# if ( ! _.isUndefined( data.model.autoplay ) && data.model.autoplay ) { #>autoplay<# } #>
+                                               <# if ( ! _.isUndefined( data.model.loop ) && data.model.loop ) { #>loop<# } #>
+                                       />
+                                       <# rendered = true; #>
+                               <label class="setting">
+                                       <span>SRC</span>
+                                       <input type="text" disabled="disabled" data-setting="src" value="{{{ data.model.src }}}" />
+                               </label>
+                               <# } #>
+                               <?php
+                               $default_types = wp_get_audio_extensions();
+
+                               foreach ( $default_types as $type ): ?>
+                               <# if ( data.model.<?php echo $type ?> ) { #>
+                                       <# if ( ! rendered ) { #>
+                                       <audio class="wp-audio-shortcode" src="{{{ data.model.<?php echo $type ?> }}}"
+                                               preload="{{{ _.isUndefined( data.model.preload ) ? 'none' : data.model.preload }}}"
+                                               <# if ( ! _.isUndefined( data.model.autoplay ) && data.model.autoplay ) { #>autoplay<# } #>
+                                               <# if ( ! _.isUndefined( data.model.loop ) && data.model.loop ) { #>loop<# } #>
+                                       />
+                                       <#
+                                               rendered = true;
+                                       } #>
+                               <label class="setting">
+                                       <span><?php echo strtoupper( $type ) ?></span>
+                                       <input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{{ data.model.<?php echo $type ?> }}}" />
+                               </label>
+                               <# } #>
+                               <?php endforeach ?>
+
+                               <div class="setting preload">
+                                       <span><?php _e( 'Preload' ); ?></span>
+                                       <div class="button-group button-large" data-setting="preload">
+                                               <button class="button" value="auto">
+                                                       <?php esc_attr_e( 'Auto' ); ?>
+                                               </button>
+                                               <button class="button" value="metadata">
+                                                       <?php esc_attr_e( 'Metadata' ); ?>
+                                               </button>
+                                               <button class="button active" value="none">
+                                                       <?php esc_attr_e( 'None' ); ?>
+                                               </button>
+                                       </div>
+                               </div>
+
+                               <label class="setting checkbox-setting">
+                                       <span><?php _e( 'Autoplay' ); ?></span>
+                                       <input type="checkbox" data-setting="autoplay" />
+                               </label>
+
+                               <label class="setting checkbox-setting">
+                                       <span><?php _e( 'Loop' ); ?></span>
+                                       <input type="checkbox" data-setting="loop" />
+                               </label>
+                               <div class="clear"></div>
+                       </div>
+               </div>
+       </script>
+
+       <script type="text/html" id="tmpl-video-details">
+               <?php // reusing .media-embed to pick up the styles for now ?>
+               <# var rendered = false; #>
+               <div class="media-embed">
+                       <div class="embed-media-settings embed-video-settings">
+                               <div class="wp-video-holder">
+                               <#
+                               var w = ! data.model.width || data.model.width > 640 ? 640 : data.model.width,
+                                       h = ! data.model.height ? 320 : data.model.height;
+
+                               if ( w !== data.model.width ) {
+                                       h = Math.ceil( ( h * w ) / data.model.width );
+                               }
+
+                               if ( data.model.src ) { #>
+                                       <video class="wp-video-shortcode"
+                                               width="{{{ w }}}"
+                                               height="{{{ h }}}"
+                                               src="{{{ data.model.src }}}"
+                                               <# if ( ! _.isUndefined( data.model.poster ) ) { #>poster="{{{ data.model.poster }}}"<# } #>
+                                               preload="{{{ _.isUndefined( data.model.preload ) ? 'metadata' : data.model.preload }}}"
+                                               <# if ( ! _.isUndefined( data.model.autoplay ) && data.model.autoplay ) { #>autoplay<# } #>
+                                               <# if ( ! _.isUndefined( data.model.loop ) && data.model.loop ) { #>loop<# } #>
+                                       />
+                                       <# rendered = true; #>
+                               <label class="setting">
+                                       <span>SRC</span>
+                                       <input type="text" disabled="disabled" data-setting="src" value="{{{ data.model.src }}}" />
+                               </label>
+                               <# } #>
+                               <?php
+                               $default_types = wp_get_video_extensions();
+
+                               foreach ( $default_types as $type ): ?>
+                               <# if ( data.model.<?php echo $type ?> ) { #>
+                                       <# if ( ! rendered ) { #>
+                                       <video class="wp-video-shortcode"
+                                               width="{{{ w }}}"
+                                               height="{{{ h }}}"
+                                               src="{{{ data.model.<?php echo $type ?> }}}"
+                                               <# if ( ! _.isUndefined( data.model.poster ) ) { #>poster="{{{ data.model.poster }}}"<# } #>
+                                               preload="{{{ _.isUndefined( data.model.preload ) ? 'metadata' : data.model.preload }}}"
+                                               <# if ( ! _.isUndefined( data.model.autoplay ) && data.model.autoplay ) { #>autoplay<# } #>
+                                               <# if ( ! _.isUndefined( data.model.loop ) && data.model.loop ) { #>loop<# } #>
+                                       />
+                                       <#
+                                               rendered = true;
+                                       } #>
+                               <label class="setting">
+                                       <span><?php echo strtoupper( $type ) ?></span>
+                                       <input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{{ data.model.<?php echo $type ?> }}}" />
+                               </label>
+                               <# } #>
+                               <?php endforeach ?>
+                               </div>
+                               <label class="setting">
+                                       <span><?php _e( 'Poster Image' ); ?></span>
+                                       <input type="text" data-setting="poster" value="{{{ data.model.poster }}}" />
+                               </label>
+                               <div class="setting preload">
+                                       <span><?php _e( 'Preload' ); ?></span>
+                                       <div class="button-group button-large" data-setting="preload">
+                                               <button class="button" value="auto">
+                                                       <?php esc_attr_e( 'Auto' ); ?>
+                                               </button>
+                                               <button class="button" value="metadata">
+                                                       <?php esc_attr_e( 'Metadata' ); ?>
+                                               </button>
+                                               <button class="button active" value="none">
+                                                       <?php esc_attr_e( 'None' ); ?>
+                                               </button>
+                                       </div>
+                               </div>
+
+                               <label class="setting checkbox-setting">
+                                       <span><?php _e( 'Autoplay' ); ?></span>
+                                       <input type="checkbox" data-setting="autoplay" />
+                               </label>
+
+                               <label class="setting checkbox-setting">
+                                       <span><?php _e( 'Loop' ); ?></span>
+                                       <input type="checkbox" data-setting="loop" />
+                               </label>
+                               <div class="clear"></div>
+                       </div>
+               </div>
+       </script>
</ins><span class="cx">   <?php
</span><span class="cx"> 
</span><span class="cx">          //TODO: do we want to deal with the fact that the elements used for gallery items are filterable and can be overriden via shortcode attributes
</span></span></pre></div>
<a id="trunksrcwpincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/media.php (27410 => 27411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/media.php  2014-03-05 12:58:27 UTC (rev 27410)
+++ trunk/src/wp-includes/media.php     2014-03-05 15:06:00 UTC (rev 27411)
</span><span class="lines">@@ -2381,6 +2381,16 @@
</span><span class="cx">          'imageReplaceTitle'     => __( 'Replace Image' ),
</span><span class="cx">          'imageDetailsCancel'    => __( 'Cancel Edit' ),
</span><span class="cx"> 
</span><ins>+               // Edit Image
+               'audioDetailsTitle'     => __( 'Audio Details' ),
+               'audioReplaceTitle'     => __( 'Replace Audio' ),
+               'audioDetailsCancel'    => __( 'Cancel Edit' ),
+
+               // Edit Image
+               'videoDetailsTitle'     => __( 'Video Details' ),
+               'videoReplaceTitle'     => __( 'Replace Video' ),
+               'videoDetailsCancel'    => __( 'Cancel Edit' ),
+
</ins><span class="cx">           // Playlist
</span><span class="cx">                  'playlistDragInfo'    => __( 'Drag and drop to reorder tracks.' ),
</span><span class="cx">                  'createPlaylistTitle' => __( 'Create Playlist' ),
</span></span></pre></div>
<a id="trunksrcwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/script-loader.php (27410 => 27411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/script-loader.php  2014-03-05 12:58:27 UTC (rev 27410)
+++ trunk/src/wp-includes/script-loader.php     2014-03-05 15:06:00 UTC (rev 27411)
</span><span class="lines">@@ -389,7 +389,7 @@
</span><span class="cx"> 
</span><span class="cx">  // To enqueue media-views or media-editor, call wp_enqueue_media().
</span><span class="cx">  // Both rely on numerous settings, styles, and templates to operate correctly.
</span><del>-       $scripts->add( 'media-views',  "/wp-includes/js/media-views$suffix.js",  array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable' ), false, 1 );
</del><ins>+        $scripts->add( 'media-views',  "/wp-includes/js/media-views$suffix.js",  array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement' ), false, 1 );
</ins><span class="cx">   $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 );
</span><span class="cx">  $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models' ), false, 1 );
</span><span class="cx"> 
</span><span class="lines">@@ -614,7 +614,7 @@
</span><span class="cx">  $styles->add( 'admin-bar',      "/wp-includes/css/admin-bar$suffix.css", array( 'open-sans', 'dashicons' ) );
</span><span class="cx">  $styles->add( 'wp-auth-check',  "/wp-includes/css/wp-auth-check$suffix.css", array( 'dashicons' ) );
</span><span class="cx">  $styles->add( 'editor-buttons', "/wp-includes/css/editor$suffix.css", array( 'dashicons' ) );
</span><del>-       $styles->add( 'media-views',    "/wp-includes/css/media-views$suffix.css", array( 'buttons', 'dashicons' ) );
</del><ins>+        $styles->add( 'media-views',    "/wp-includes/css/media-views$suffix.css", array( 'buttons', 'dashicons', 'wp-mediaelement' ) );
</ins><span class="cx">   $styles->add( 'wp-pointer',     "/wp-includes/css/wp-pointer$suffix.css", array( 'dashicons' ) );
</span><span class="cx"> 
</span><span class="cx">  // External libraries and friends
</span></span></pre>
</div>
</div>

</body>
</html>