WordPress/wp-includes/js/media/views/video-details.js
Scott Taylor 6848035d1a Restore the changes I made in [31016] for chromeless Vimeo that were missed in [31373].
Make sure that the build file for `grid` doesn't load `views/media-details.js`, it already exists in the `audio-video` build.

See #29267, #28510.

Built from https://develop.svn.wordpress.org/trunk@31487


git-svn-id: http://core.svn.wordpress.org/trunk@31468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-22 05:38:27 +00:00

42 lines
913 B
JavaScript

/**
* wp.media.view.VideoDetails
*
* @constructor
* @augments wp.media.view.MediaDetails
* @augments wp.media.view.Settings.AttachmentDisplay
* @augments wp.media.view.Settings
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var MediaDetails = require( './media-details' ),
VideoDetails;
VideoDetails = MediaDetails.extend({
className: 'video-details',
template: wp.template('video-details'),
setMedia: function() {
var video = this.$('.wp-video-shortcode');
if ( video.find( 'source' ).length ) {
if ( video.is(':hidden') ) {
video.show();
}
if ( ! video.hasClass( 'youtube-video' ) && ! video.hasClass( 'vimeo-video' ) ) {
this.media = MediaDetails.prepareSrc( video.get(0) );
} else {
this.media = video.get(0);
}
} else {
video.hide();
this.media = false;
}
return this;
}
});
module.exports = VideoDetails;