Index: /trunk/src/wp-admin/includes/ajax-actions.php
===================================================================
--- /trunk/src/wp-admin/includes/ajax-actions.php	(revision 31619)
+++ /trunk/src/wp-admin/includes/ajax-actions.php	(revision 31620)
@@ -2709,5 +2709,13 @@
 
 	$shortcode = wp_unslash( $_POST['shortcode'] );
-	$url = str_replace( '[embed]', '', str_replace( '[/embed]', '', $shortcode ) );
+
+	preg_match( '/' . get_shortcode_regex() . '/s', $shortcode, $matches );
+	$atts = shortcode_parse_atts( $matches[3] );
+	if ( ! empty( $atts[5] ) ) {
+		$url = $atts[5];
+	} elseif ( ! empty( $atts['src'] ) ) {
+		$url = $atts['src'];
+	}
+
 	$parsed = false;
 	setup_postdata( $post );
@@ -2715,5 +2723,5 @@
 	$wp_embed->return_false_on_fail = true;
 
-	if ( is_ssl() && preg_match( '%^\\[embed[^\\]]*\\]http://%i', $shortcode ) ) {
+	if ( is_ssl() && 0 === strpos( $url, 'http://' ) ) {
 		// Admin is ssl and the user pasted non-ssl URL.
 		// Check if the provider supports ssl embeds and use that for the preview.
@@ -2768,5 +2776,6 @@
 
 	wp_send_json_success( array(
-		'body' => $parsed
+		'body' => $parsed,
+		'attr' => $wp_embed->last_attr
 	) );
 }
Index: /trunk/src/wp-includes/class-wp-embed.php
===================================================================
--- /trunk/src/wp-includes/class-wp-embed.php	(revision 31619)
+++ /trunk/src/wp-includes/class-wp-embed.php	(revision 31620)
@@ -12,4 +12,6 @@
 	public $usecache = true;
 	public $linkifunknown = true;
+	public $last_attr = array();
+	public $last_url = '';
 
 	/**
@@ -135,9 +137,15 @@
 		}
 
-		if ( empty( $url ) )
+		$this->last_url = $url;
+
+		if ( empty( $url ) ) {
+			$this->last_attr = $attr;
 			return '';
+		}
 
 		$rawattr = $attr;
 		$attr = wp_parse_args( $attr, wp_embed_defaults( $url ) );
+
+		$this->last_attr = $attr;
 
 		// kses converts & into &amp; and we need to undo this
Index: /trunk/src/wp-includes/css/media-views.css
===================================================================
--- /trunk/src/wp-includes/css/media-views.css	(revision 31619)
+++ /trunk/src/wp-includes/css/media-views.css	(revision 31620)
@@ -1945,4 +1945,27 @@
 }
 
+.embed-link-settings .setting {
+	display: none;
+}
+
+.embed-link-dimensions:after {
+	content: '';
+	display: block;
+	clear: both;
+}
+
+.embed-link-dimensions .width,
+.embed-link-dimensions .height {
+	float: left;
+	width: 125px;
+	clear: none;
+	margin-right: 10px;
+}
+
+.embed-link-dimensions input {
+	width: auto;
+	max-width: 110px;
+}
+
 .image-details .embed-media-settings .setting {
 	float: none;
@@ -1991,4 +2014,5 @@
 	display: block;
 	width: 200px;
+	max-width: 100%;
 	font-size: 13px;
 	line-height: 24px;
Index: /trunk/src/wp-includes/js/mce-view.js
===================================================================
--- /trunk/src/wp-includes/js/mce-view.js	(revision 31619)
+++ /trunk/src/wp-includes/js/mce-view.js	(revision 31620)
@@ -820,10 +820,11 @@
 			var media = wp.media.embed,
 				frame = media.edit( text, !! this.url ),
-				self = this;
+				self = this,
+				events = 'change:url change:width change:height';
 
 			this.pausePlayers();
 
-			frame.state( 'embed' ).props.on( 'change:url', function( model, url ) {
-				if ( url ) {
+			frame.state( 'embed' ).props.on( events, function( model, url ) {
+				if ( url && model.get( 'url' ) ) {
 					frame.state( 'embed' ).metadata = model.toJSON();
 				}
@@ -831,8 +832,16 @@
 
 			frame.state( 'embed' ).on( 'select', function() {
-				if ( self.url ) {
-					update( frame.state( 'embed' ).metadata.url );
+				var data = frame.state( 'embed' ).metadata;
+
+				if ( data.width ) {
+					delete self.url;
 				} else {
-					update( media.shortcode( frame.state( 'embed' ).metadata ).string() );
+					self.url = data.url;
+				}
+
+				if ( self.url  ) {
+					update( data.url );
+				} else {
+					update( media.shortcode( data ).string() );
 				}
 			} );
Index: /trunk/src/wp-includes/js/media/views.js
===================================================================
--- /trunk/src/wp-includes/js/media/views.js	(revision 31619)
+++ /trunk/src/wp-includes/js/media/views.js	(revision 31620)
@@ -4598,11 +4598,10 @@
 		this.spinner = $('<span class="spinner" />');
 		this.$el.append( this.spinner[0] );
-		this.listenTo( this.model, 'change:url', this.updateoEmbed );
-	},
-
-	updateoEmbed: function() {
+		this.listenTo( this.model, 'change:url change:width change:height', this.updateoEmbed );
+	},
+
+	updateoEmbed: _.debounce( function() {
 		var url = this.model.get( 'url' );
 
-		this.$('.setting.title').show();
 		// clear out previous results
 		this.$('.embed-container').hide().find('.embed-preview').html('');
@@ -4615,8 +4614,10 @@
 		this.spinner.show();
 
-		setTimeout( _.bind( this.fetch, this ), 500 );
-	},
+		this.fetch();
+	}, 600 ),
 
 	fetch: function() {
+		var embed;
+
 		// check if they haven't typed in 500 ms
 		if ( $('#embed-url-field').val() !== this.model.get('url') ) {
@@ -4624,8 +4625,14 @@
 		}
 
+		embed = new wp.shortcode({
+			tag: 'embed',
+			attrs: _.pick( this.model.attributes, [ 'width', 'height', 'src' ] ),
+			content: this.model.get('url')
+		});
+
 		wp.ajax.send( 'parse-embed', {
 			data : {
 				post_ID: wp.media.view.settings.post.id,
-				shortcode: '[embed]' + this.model.get('url') + '[/embed]'
+				shortcode: embed.string()
 			}
 		} ).done( _.bind( this.renderoEmbed, this ) );
@@ -4633,9 +4640,30 @@
 
 	renderoEmbed: function( response ) {
-		var html = ( response && response.body ) || '';
+		var html = ( response && response.body ) || '',
+			attr = {},
+			opts = { silent: true };
+
+		if ( response && response.attr ) {
+			attr = response.attr;
+
+			_.each( [ 'width', 'height' ], function ( key ) {
+				var $el = this.$( '.setting.' + key ),
+					value = attr[ key ];
+
+				if ( value ) {
+					this.model.set( key, value, opts );
+					$el.show().find( 'input' ).val( value );
+				} else {
+					this.model.unset( key, opts );
+					$el.hide().find( 'input' ).val( '' );
+				}
+			}, this );
+		} else {
+			this.model.unset( 'height', opts );
+			this.model.unset( 'width', opts );
+		}
 
 		this.spinner.hide();
-
-		this.$('.setting.title').hide();
+		
 		this.$('.embed-container').show().find('.embed-preview').html( html );
 	}
Index: /trunk/src/wp-includes/js/media/views/embed/link.js
===================================================================
--- /trunk/src/wp-includes/js/media/views/embed/link.js	(revision 31619)
+++ /trunk/src/wp-includes/js/media/views/embed/link.js	(revision 31620)
@@ -21,11 +21,10 @@
 		this.spinner = $('<span class="spinner" />');
 		this.$el.append( this.spinner[0] );
-		this.listenTo( this.model, 'change:url', this.updateoEmbed );
+		this.listenTo( this.model, 'change:url change:width change:height', this.updateoEmbed );
 	},
 
-	updateoEmbed: function() {
+	updateoEmbed: _.debounce( function() {
 		var url = this.model.get( 'url' );
 
-		this.$('.setting.title').show();
 		// clear out previous results
 		this.$('.embed-container').hide().find('.embed-preview').html('');
@@ -38,8 +37,10 @@
 		this.spinner.show();
 
-		setTimeout( _.bind( this.fetch, this ), 500 );
-	},
+		this.fetch();
+	}, 600 ),
 
 	fetch: function() {
+		var embed;
+
 		// check if they haven't typed in 500 ms
 		if ( $('#embed-url-field').val() !== this.model.get('url') ) {
@@ -47,8 +48,14 @@
 		}
 
+		embed = new wp.shortcode({
+			tag: 'embed',
+			attrs: _.pick( this.model.attributes, [ 'width', 'height', 'src' ] ),
+			content: this.model.get('url')
+		});
+
 		wp.ajax.send( 'parse-embed', {
 			data : {
 				post_ID: wp.media.view.settings.post.id,
-				shortcode: '[embed]' + this.model.get('url') + '[/embed]'
+				shortcode: embed.string()
 			}
 		} ).done( _.bind( this.renderoEmbed, this ) );
@@ -56,9 +63,30 @@
 
 	renderoEmbed: function( response ) {
-		var html = ( response && response.body ) || '';
+		var html = ( response && response.body ) || '',
+			attr = {},
+			opts = { silent: true };
+
+		if ( response && response.attr ) {
+			attr = response.attr;
+
+			_.each( [ 'width', 'height' ], function ( key ) {
+				var $el = this.$( '.setting.' + key ),
+					value = attr[ key ];
+
+				if ( value ) {
+					this.model.set( key, value, opts );
+					$el.show().find( 'input' ).val( value );
+				} else {
+					this.model.unset( key, opts );
+					$el.hide().find( 'input' ).val( '' );
+				}
+			}, this );
+		} else {
+			this.model.unset( 'height', opts );
+			this.model.unset( 'width', opts );
+		}
 
 		this.spinner.hide();
-
-		this.$('.setting.title').hide();
+		
 		this.$('.embed-container').show().find('.embed-preview').html( html );
 	}
Index: /trunk/src/wp-includes/media-template.php
===================================================================
--- /trunk/src/wp-includes/media-template.php	(revision 31619)
+++ /trunk/src/wp-includes/media-template.php	(revision 31620)
@@ -820,4 +820,14 @@
 			<input type="text" class="alignment" data-setting="title" />
 		</label>
+		<div class="embed-link-dimensions">
+			<label class="setting width">
+				<span><?php _e( 'Maximum Width' ); ?></span>
+				<input type="text" class="alignment" data-setting="width" />
+			</label>
+			<label class="setting height">
+				<span><?php _e( 'Maximum Height' ); ?></span>
+				<input type="text" class="alignment" data-setting="height" />
+			</label>
+		</div>
 		<div class="embed-container" style="display: none;">
 			<div class="embed-preview"></div>
