<!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>[27481] trunk/src/wp-includes: Video editing in the media modal:</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/27481">27481</a></dd>
<dt>Author</dt> <dd>wonderboymusic</dd>
<dt>Date</dt> <dd>2014-03-09 10:31:36 +0000 (Sun, 09 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Video editing in the media modal:

* Add a state: `Add Subititles`
* Add `text/vtt` to the list of allowed mime-types, files end in `.vtt`. `.srt` files are served as `text/plain`.
* The content body of a video shortcode should be used for adding `<track>` elements only. This happens dynamically in the modal. If added by hand, they can still be parsed and managed.

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

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesfunctionsphp">trunk/src/wp-includes/functions.php</a></li>
<li><a href="#trunksrcwpincludesjsmediaeditorjs">trunk/src/wp-includes/js/media-editor.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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/functions.php (27480 => 27481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/functions.php      2014-03-09 06:23:18 UTC (rev 27480)
+++ trunk/src/wp-includes/functions.php 2014-03-09 10:31:36 UTC (rev 27481)
</span><span class="lines">@@ -1983,6 +1983,7 @@
</span><span class="cx">  'rtx' => 'text/richtext',
</span><span class="cx">  'css' => 'text/css',
</span><span class="cx">  'htm|html' => 'text/html',
</span><ins>+       'vtt' => 'text/vtt',
</ins><span class="cx">   // Audio formats
</span><span class="cx">  'mp3|m4a|m4b' => 'audio/mpeg',
</span><span class="cx">  'ra|ram' => 'audio/x-realaudio',
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaeditorjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-editor.js (27480 => 27481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-editor.js 2014-03-09 06:23:18 UTC (rev 27480)
+++ trunk/src/wp-includes/js/media-editor.js    2014-03-09 10:31:36 UTC (rev 27481)
</span><span class="lines">@@ -609,26 +609,33 @@
</span><span class="cx">                  poster : '',
</span><span class="cx">                  loop : false,
</span><span class="cx">                  autoplay : false,
</span><del>-                       preload : 'metadata'
</del><ins>+                        preload : 'metadata',
+                       content : ''
</ins><span class="cx">           },
</span><span class="cx"> 
</span><span class="cx">          edit : function (data) {
</span><del>-                       var frame, shortcode = wp.shortcode.next( 'video', data ).shortcode;
</del><ins>+                        var frame,
+                               defaults = this.defaults,
+                               shortcode = wp.shortcode.next( 'video', data ).shortcode,
+                               attrs;
+
+                       attrs = shortcode.attrs.named;
+                       attrs.content = shortcode.content;
+
</ins><span class="cx">                   frame = wp.media({
</span><span class="cx">                          frame: 'video',
</span><span class="cx">                          state: 'video-details',
</span><del>-                               metadata: _.defaults(
-                                       shortcode.attrs.named,
-                                       wp.media.video.defaults
-                               )
</del><ins>+                                metadata: _.defaults( attrs, defaults )
</ins><span class="cx">                   });
</span><span class="cx"> 
</span><span class="cx">                  return frame;
</span><span class="cx">          },
</span><span class="cx"> 
</span><span class="cx">          shortcode : function (shortcode) {
</span><del>-                       var self = this;
-                       _.each( wp.media.video.defaults, function( value, key ) {
</del><ins>+                        var self = this, content = shortcode.content;
+                       delete shortcode.content;
+
+                       _.each( this.defaults, function( value, key ) {
</ins><span class="cx">                           shortcode[ key ] = self.coerce( shortcode, key );
</span><span class="cx"> 
</span><span class="cx">                          if ( value === shortcode[ key ] ) {
</span><span class="lines">@@ -638,7 +645,8 @@
</span><span class="cx"> 
</span><span class="cx">                  return wp.shortcode.string({
</span><span class="cx">                          tag:     'video',
</span><del>-                               attrs:   shortcode
</del><ins>+                                attrs:   shortcode,
+                               content: content
</ins><span class="cx">                   });
</span><span class="cx">          }
</span><span class="cx">  }, wp.media.mixin);
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-views.js (27480 => 27481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-views.js  2014-03-09 06:23:18 UTC (rev 27480)
+++ trunk/src/wp-includes/js/media-views.js     2014-03-09 10:31:36 UTC (rev 27481)
</span><span class="lines">@@ -1193,41 +1193,16 @@
</span><span class="cx">  media.controller.MediaLibrary = media.controller.Library.extend({
</span><span class="cx">          defaults: _.defaults({
</span><span class="cx">                  filterable: 'uploaded',
</span><del>-                       multiple:   false,
</del><span class="cx">                   priority:   80,
</span><span class="cx">                  syncSelection: false,
</span><del>-                       displaySettings: true
</del><ins>+                        displaySettings: false
</ins><span class="cx">           }, media.controller.Library.prototype.defaults ),
</span><span class="cx"> 
</span><span class="cx">          initialize: function( options ) {
</span><del>-                       var library, comparator;
-
</del><span class="cx">                   this.media = options.media;
</span><span class="cx">                  this.set( 'library', media.query({ type: options.type }) );
</span><span class="cx"> 
</span><span class="cx">                  media.controller.Library.prototype.initialize.apply( this, arguments );
</span><del>-
-                       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') );
</del><span class="cx">           }
</span><span class="cx">  });
</span><span class="cx"> 
</span><span class="lines">@@ -2952,6 +2927,7 @@
</span><span class="cx">                  this.on( 'toolbar:render:replace-video', this.renderReplaceToolbar, this );
</span><span class="cx">                  this.on( 'toolbar:render:add-video-source', this.renderAddSourceToolbar, this );
</span><span class="cx">                  this.on( 'toolbar:render:select-poster-image', this.renderSelectPosterImageToolbar, this );
</span><ins>+                       this.on( 'toolbar:render:add-track', this.renderAddTrackToolbar, this );
</ins><span class="cx">           },
</span><span class="cx"> 
</span><span class="cx">          createStates: function() {
</span><span class="lines">@@ -2987,6 +2963,15 @@
</span><span class="cx">                                  toolbar: 'select-poster-image',
</span><span class="cx">                                  media: this.media,
</span><span class="cx">                                  menu: 'video-details'
</span><ins>+                               } ),
+
+                               new media.controller.MediaLibrary( {
+                                       type: 'text',
+                                       id: 'add-track',
+                                       title: l10n.videoAddTrackTitle,
+                                       toolbar: 'add-track',
+                                       media: this.media,
+                                       menu: 'video-details'
</ins><span class="cx">                           } )
</span><span class="cx">                  ]);
</span><span class="cx">          },
</span><span class="lines">@@ -3017,6 +3002,43 @@
</span><span class="cx">                                  }
</span><span class="cx">                          }
</span><span class="cx">                  }) );
</span><ins>+               },
+
+               renderAddTrackToolbar: function() {
+                       this.toolbar.set( new media.view.Toolbar({
+                               controller: this,
+                               items: {
+                                       replace: {
+                                               style:    'primary',
+                                               text:     l10n.videoAddTrackTitle,
+                                               priority: 80,
+
+                                               click: function() {
+                                                       var controller = this.controller,
+                                                               state = controller.state(),
+                                                               selection = state.get( 'selection' ),
+                                                               attachment = selection.single(),
+                                                               content = controller.media.get( 'content' );
+
+                                                       if ( -1 === content.indexOf( attachment.get( 'url' ) ) ) {
+                                                               content += [
+                                                                       '<track srclang="en" label="English"kind="subtitles" src="',
+                                                                       attachment.get( 'url' ),
+                                                                       '" />'
+                                                               ].join('');
+
+                                                               controller.media.set( 'content', content );
+                                                       }
+
+                                                       state.trigger( 'add-track', controller.media.toJSON() );
+
+                                                       // Restore and reset the default state.
+                                                       controller.setState( controller.options.state );
+                                                       controller.reset();
+                                               }
+                                       }
+                               }
+                       }) );
</ins><span class="cx">           }
</span><span class="cx">  });
</span><span class="cx"> 
</span><span class="lines">@@ -6366,21 +6388,17 @@
</span><span class="cx">                  this.on( 'media:setting:remove', this.render );
</span><span class="cx">                  this.on( 'media:setting:remove', this.setPlayer );
</span><span class="cx">                  this.events = _.extend( this.events, {
</span><del>-                               'click .remove-setting' : 'removeSetting'
</del><ins>+                                'click .remove-setting' : 'removeSetting',
+                               'change .content-track' : 'setTracks',
+                               'click .remove-track' : 'setTracks'
</ins><span class="cx">                   } );
</span><span class="cx"> 
</span><span class="cx">                  media.view.Settings.AttachmentDisplay.prototype.initialize.apply( this, arguments );
</span><span class="cx">          },
</span><span class="cx"> 
</span><span class="cx">          prepare: function() {
</span><del>-                       var attachment = false;
-
-                       if ( this.model.attachment ) {
-                               attachment = this.model.attachment.toJSON();
-                       }
</del><span class="cx">                   return _.defaults({
</span><del>-                               model: this.model.toJSON(),
-                               attachment: attachment
</del><ins>+                                model: this.model.toJSON()
</ins><span class="cx">                   }, this.options );
</span><span class="cx">          },
</span><span class="cx"> 
</span><span class="lines">@@ -6404,12 +6422,26 @@
</span><span class="cx">          },
</span><span class="cx"> 
</span><span class="cx">          removeSetting : function (e) {
</span><del>-                       var setting = $( e.currentTarget ).parent();
</del><ins>+                        var wrap = $( e.currentTarget ).parent(), setting;
</ins><span class="cx"> 
</span><del>-                       this.model.unset( setting.find( 'input' ).data( 'setting' ) );
</del><ins>+                        setting = wrap.find( 'input' ).data( 'setting' );
</ins><span class="cx"> 
</span><del>-                       setting.remove();
</del><ins>+                        if ( setting ) {
+                               this.model.unset( setting );
+                               this.trigger( 'media:setting:remove', this );
+                       }
</ins><span class="cx"> 
</span><ins>+                       wrap.remove();
+               },
+
+               setTracks : function () {
+                       var tracks = '';
+
+                       _.each( this.$('.content-track'), function (track) {
+                               tracks += $( track ).val();
+                       } );
+
+                       this.model.set( 'content', tracks );
</ins><span class="cx">                   this.trigger( 'media:setting:remove', this );
</span><span class="cx">          },
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaelementwpmediaelementcss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/mediaelement/wp-mediaelement.css (27480 => 27481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/mediaelement/wp-mediaelement.css        2014-03-09 06:23:18 UTC (rev 27480)
+++ trunk/src/wp-includes/js/mediaelement/wp-mediaelement.css   2014-03-09 10:31:36 UTC (rev 27481)
</span><span class="lines">@@ -19,6 +19,11 @@
</span><span class="cx">  max-width: 400px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.media-embed-details .embed-media-settings .setting span {
+       max-width: 400px;
+       width: auto;
+}
+
</ins><span class="cx"> .media-embed-details .embed-media-settings {
</span><span class="cx">  padding-top: 0;
</span><span class="cx"> }
</span><span class="lines">@@ -28,8 +33,11 @@
</span><span class="cx">  max-width: 600px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.media-embed-details .setting p,
</ins><span class="cx"> .media-embed-details .setting a {
</span><span class="cx">  color: #a00;
</span><ins>+       font-size: 10px;
+       text-transform: uppercase;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .media-embed-details .setting a:hover {
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpgallerypluginjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js (27480 => 27481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js     2014-03-09 06:23:18 UTC (rev 27480)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js        2014-03-09 10:31:36 UTC (rev 27481)
</span><span class="lines">@@ -97,11 +97,14 @@
</span><span class="cx">                  frame.on( 'close', function () {
</span><span class="cx">                          frame.detach();
</span><span class="cx">                  } );
</span><del>-                       frame.state( 'video-details' ).on( 'update replace add-source select-poster-image', function ( selection ) {
-                               var shortcode = wp.media.video.shortcode( selection );
-                               editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
-                               frame.detach();
-                       } );
</del><ins>+                        frame.state( 'video-details' ).on(
+                               'update replace add-source select-poster-image add-track',
+                               function ( selection ) {
+                                       var shortcode = wp.media.video.shortcode( selection );
+                                       editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
+                                       frame.detach();
+                               }
+                       );
</ins><span class="cx">                   frame.open();
</span><span class="cx">          } else if ( editor.dom.hasClass( node, 'wp-audio' ) ) {
</span><span class="cx">                  frame = wp.media.audio.edit( data );
</span></span></pre></div>
<a id="trunksrcwpincludesmediatemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/media-template.php (27480 => 27481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/media-template.php 2014-03-09 06:23:18 UTC (rev 27480)
+++ trunk/src/wp-includes/media-template.php    2014-03-09 10:31:36 UTC (rev 27481)
</span><span class="lines">@@ -690,7 +690,7 @@
</span><span class="cx">                          <label class="setting">
</span><span class="cx">                                  <span>SRC</span>
</span><span class="cx">                                  <input type="text" disabled="disabled" data-setting="src" value="{{ data.model.src }}" />
</span><del>-                                       <a class="remove-setting">{{{ wp.media.view.l10n.audioRemoveSource }}}</a>
</del><ins>+                                        <a class="remove-setting">{{{ wp.media.view.l10n.remove }}}</a>
</ins><span class="cx">                           </label>
</span><span class="cx">                          <# } #>
</span><span class="cx">                          <?php
</span><span class="lines">@@ -700,7 +700,7 @@
</span><span class="cx">                          <label class="setting">
</span><span class="cx">                                  <span><?php echo strtoupper( $type ) ?></span>
</span><span class="cx">                                  <input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{ data.model.<?php echo $type ?> }}" />
</span><del>-                                       <a class="remove-setting">{{{ wp.media.view.l10n.audioRemoveSource }}}</a>
</del><ins>+                                        <a class="remove-setting">{{{ wp.media.view.l10n.remove }}}</a>
</ins><span class="cx">                           </label>
</span><span class="cx">                          <# } #>
</span><span class="cx">                          <?php endforeach ?>
</span><span class="lines">@@ -779,13 +779,14 @@
</span><span class="cx">                                  ?><# if ( data.model.<?php echo $type ?> ) { #>
</span><span class="cx">                                  <source src="{{ data.model.<?php echo $type ?> }}" type="{{ wp.media.view.settings.embedMimes[ '<?php echo $type ?>' ] }}" />
</span><span class="cx">                                  <# } #>
</span><del>-                                       <?php endforeach;
-                               ?></video>
</del><ins>+                                        <?php endforeach; ?>
+                                       {{{ data.model.content }}}
+                               </video>
</ins><span class="cx">                           <# if ( ! _.isEmpty( data.model.src ) ) { #>
</span><span class="cx">                          <label class="setting">
</span><span class="cx">                                  <span>SRC</span>
</span><span class="cx">                                  <input type="text" disabled="disabled" data-setting="src" value="{{ data.model.src }}" />
</span><del>-                                       <a class="remove-setting">{{{ wp.media.view.l10n.videoRemoveSource }}}</a>
</del><ins>+                                        <a class="remove-setting">{{{ wp.media.view.l10n.remove }}}</a>
</ins><span class="cx">                           </label>
</span><span class="cx">                          <# } #>
</span><span class="cx">                          <?php foreach ( $video_types as $type ):
</span><span class="lines">@@ -793,7 +794,7 @@
</span><span class="cx">                          <label class="setting">
</span><span class="cx">                                  <span><?php echo strtoupper( $type ) ?></span>
</span><span class="cx">                                  <input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{ data.model.<?php echo $type ?> }}" />
</span><del>-                                       <a class="remove-setting">{{{ wp.media.view.l10n.videoRemoveSource }}}</a>
</del><ins>+                                        <a class="remove-setting">{{{ wp.media.view.l10n.remove }}}</a>
</ins><span class="cx">                           </label>
</span><span class="cx">                          <# } #>
</span><span class="cx">                          <?php endforeach ?>
</span><span class="lines">@@ -802,7 +803,7 @@
</span><span class="cx">                          <label class="setting">
</span><span class="cx">                                  <span><?php _e( 'Poster Image' ); ?></span>
</span><span class="cx">                                  <input type="text" disabled="disabled" data-setting="poster" value="{{ data.model.poster }}" />
</span><del>-                                       <a class="remove-setting">{{{ wp.media.view.l10n.videoRemovePoster }}}</a>
</del><ins>+                                        <a class="remove-setting">{{{ wp.media.view.l10n.remove }}}</a>
</ins><span class="cx">                           </label>
</span><span class="cx">                          <# } #>
</span><span class="cx">                          <div class="setting preload">
</span><span class="lines">@@ -824,6 +825,25 @@
</span><span class="cx">                                  <input type="checkbox" data-setting="loop" />
</span><span class="cx">                          </label>
</span><span class="cx">                          <div class="clear"></div>
</span><ins>+
+                               <label class="setting" data-setting="content">
+                                       <span><?php _e( 'Tracks (subtitles, captions, descriptions, chapters or metadata)' ); ?></span>
+                                       <#
+                                       var content = '';
+                                       if ( ! _.isEmpty( data.model.content ) ) {
+                                               var tracks = jQuery( data.model.content ).filter( 'track' );
+                                               _.each( tracks.toArray(), function (track) {
+                                                       content += track.outerHTML; #>
+                                               <p>
+                                                       <input class="content-track" type="text" value="{{ track.outerHTML }}" />
+                                                       <a class="remove-setting remove-track">{{{ wp.media.view.l10n.remove }}}</a>
+                                               </p>
+                                               <# } ); #>
+                                       <# } else { #>
+                                       <em>There are no associated subtitles.</em>
+                                       <# } #>
+                                       <textarea class="hidden content-setting">{{ content }}</textarea>
+                               </label>
</ins><span class="cx">                   </div>
</span><span class="cx">          </div>
</span><span class="cx">  </script>
</span></span></pre></div>
<a id="trunksrcwpincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/media.php (27480 => 27481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/media.php  2014-03-09 06:23:18 UTC (rev 27480)
+++ trunk/src/wp-includes/media.php     2014-03-09 10:31:36 UTC (rev 27481)
</span><span class="lines">@@ -2395,7 +2395,8 @@
</span><span class="cx">          'cancel'      => __( 'Cancel' ),
</span><span class="cx">          'update'      => __( 'Update' ),
</span><span class="cx">          'replace'     => __( 'Replace' ),
</span><del>-               'back'     => __( 'Back' ),
</del><ins>+                'remove'      => __( 'Remove' ),
+               'back'        => __( 'Back' ),
</ins><span class="cx">           /* translators: This is a would-be plural string used in the media manager.
</span><span class="cx">             If there is not a word you can use in your language to avoid issues with the
</span><span class="cx">             lack of plural support here, turn it into "selected: %d" then translate it.
</span><span class="lines">@@ -2450,7 +2451,6 @@
</span><span class="cx">          'audioDetailsCancel'    => __( 'Cancel Edit' ),
</span><span class="cx">          'audioDetailsText'      => __( '"Replace Audio" will remove all associated source files when you update. ' .
</span><span class="cx">                  '"Add Audio Source" allows you to specify alternate sources for maximum native HTML5 audio playback.' ),
</span><del>-               'audioRemoveSource'     => __( 'Remove Audio Source' ),
</del><span class="cx"> 
</span><span class="cx">          // Edit Video
</span><span class="cx">          'videoDetailsTitle'     => __( 'Video Details' ),
</span><span class="lines">@@ -2459,9 +2459,8 @@
</span><span class="cx">          'videoDetailsCancel'    => __( 'Cancel Edit' ),
</span><span class="cx">          'videoDetailsText'      => __( '"Replace Video" will remove all associated source files when you update. ' .
</span><span class="cx">                  '"Add Video Source" allows you to specify alternate sources for maximum native HTML5 video playback.' ),
</span><del>-               'videoRemoveSource'     => __( 'Remove Video Source' ),
</del><span class="cx">           'videoSelectPosterImageTitle' => _( 'Select Poster Image' ),
</span><del>-               'videoRemovePoster'     => __( 'Remove Poster Image' ),
</del><ins>+                'videoAddTrackTitle'    => __( 'Add Subtitles' ),
</ins><span class="cx"> 
</span><span class="cx">                  // Playlist
</span><span class="cx">                  'playlistDragInfo'    => __( 'Drag and drop to reorder tracks.' ),
</span></span></pre>
</div>
</div>

</body>
</html>