Index: trunk/extensions/OggHandler/OggPlayer.js |
— | — | @@ -183,7 +183,9 @@ |
184 | 184 | } |
185 | 185 | |
186 | 186 | // <video> element |
187 | | - if ( typeof HTMLVideoElement == 'object' ) { |
| 187 | + if ( typeof HTMLVideoElement == 'object' // Firefox, Safari |
| 188 | + || typeof HTMLVideoElement == 'function' ) // Opera |
| 189 | + { |
188 | 190 | this.clientSupports['videoElement'] = true; |
189 | 191 | } |
190 | 192 | |
— | — | @@ -504,26 +506,16 @@ |
505 | 507 | }, |
506 | 508 | |
507 | 509 | 'embedVideoElement': function ( elt, params ) { |
508 | | - var videoElt = document.createElement('video'); |
509 | | - videoElt.setAttribute( 'width', params.width ); |
510 | | - videoElt.setAttribute( 'height', params.height + this.controlsHeightGuess ); |
511 | | - videoElt.setAttribute( 'src', params.videoUrl ); |
512 | | - videoElt.setAttribute( 'autoplay', '1' ); |
513 | | - videoElt.setAttribute( 'controls', '1' ); |
514 | | - var div = document.createElement( 'div' ); |
515 | | - div.appendChild( videoElt ); |
516 | | - elt.appendChild( div ); |
517 | | - |
518 | | - // Try to detect implementations that don't support controls |
519 | | - // This works for the Opera test build |
520 | | - if ( !videoElt.controls ) { |
521 | | - div = document.createElement( 'div' ); |
522 | | - div.appendChild( this.newPlayButton( videoElt ) ); |
523 | | - div.appendChild( this.newPauseButton( videoElt ) ); |
524 | | - div.appendChild( this.newStopButton( videoElt ) ); |
525 | | - elt.appendChild( div ); |
526 | | - //videoElt.play(); |
527 | | - } |
| 510 | + var id = elt.id + "_obj"; |
| 511 | + elt.innerHTML = |
| 512 | + '<div><video' + |
| 513 | + ' id=' + this.hq( id ) + |
| 514 | + ' width=' + this.hq( params.width ) + |
| 515 | + ' height=' + this.hq( params.height ) + |
| 516 | + ' src=' + this.hq( params.videoUrl ) + |
| 517 | + ' autoplay="1"' + |
| 518 | + ' controls="1"' + |
| 519 | + ' /></div>'; |
528 | 520 | }, |
529 | 521 | |
530 | 522 | 'embedOggPlugin': function ( elt, params, player ) { |