diff --git a/Plugin/Plugin.m b/Plugin/Plugin.m index 8f8ccf89..d8642c4f 100755 --- a/Plugin/Plugin.m +++ b/Plugin/Plugin.m @@ -1271,18 +1271,21 @@ - (void) _convertElementForMP4: (DOMElement*) element } [ element setAttribute: @"src" value: src ]; - [ element setAttribute: @"type" value: @"video/mp4" ]; - [ element setAttribute: @"scale" value: @"aspect" ]; - [ element setAttribute: @"autoplay" value: @"true" ]; - [ element setAttribute: @"cache" value: @"false" ]; - - if( ! [ element hasAttribute: @"width" ] ) + [ element setAttribute: @"autobuffer" value:@"autobuffer"]; + [ element setAttribute: @"autoplay" value:@"autoplay"]; + [ element setAttribute: @"controls" value:@"controls"]; + + DOMElement* container = [self container]; + + if( [ container hasAttribute: @"width" ] ) + [ element setAttribute: @"width" value:[ container getAttribute:@"width"]]; + else [ element setAttribute: @"width" value: @"640" ]; - if( ! [ element hasAttribute: @"height" ] ) + if( [ container hasAttribute: @"height" ] ) + [ element setAttribute: @"height" value:[ container getAttribute:@"height"]]; + else [ element setAttribute: @"height" value: @"500" ]; - - [ element setAttribute: @"flashvars" value: nil ]; } - (void) _convertToMP4Container @@ -1296,7 +1299,7 @@ - (void) _convertToMP4Container - (void) _convertToMP4ContainerAfterDelay { - DOMElement* newElement = (DOMElement*) [ [self container] cloneNode: NO ]; + DOMElement* newElement = [[[self container] ownerDocument] createElement:@"video"]; [ self _convertElementForMP4: newElement ];