多くのテストを行った結果、動画属性の順序によって、メディア要素で動画を正しく再生する際に大きな違いが生じることがわかりました。以下の設定を使用すると、すべてのブラウザで YouTube 動画を再生およびサイズ変更できます。myvids div の 50% 幅は奇妙に見えますが、これがないと IE でビデオのサイズが適切に調整されません。現時点で解決しようとしている問題は 1 つだけです。iPad で開くと、再生ボタンがビデオの左上隅に移動します。パーセンテージの代わりにビデオの幅と高さを設定すると、再生ボタンは正しく表示されますが、プレーヤーのサイズが変更されません。
<div class="myvids" id="viddivap1" width="50%" style="width:100%;position:relative;">
<video class="thevid" width="640" height="360" style="max-width:100%;height:100%;" id="my_video_ap1" preload="auto" autoplay controls="controls" >
<source type="video/youtube" src="http://www.youtube.com/watch?v=FAGL9gxhdHM" />
<span style="color:white;">Your browser does not support HTML5, Flash, or Silverlight. Please update your browser.</span>
</video>
</div>
$('video').mediaelementplayer({
// if set, overrides <video width>
videoWidth: -1,
// if set, overrides <video height>
videoHeight: -1,
// width of audio player
audioWidth: 400,
// height of audio player
audioHeight: 30,
// initial volume when the player starts
startVolume: 0.8,
// useful for <audio> player loops
loop: false,
// enables Flash and Silverlight to resize to content size
enableAutosize: true,
// the order of controls you want on the control bar (and other plugins below)
features: ['playpause','progress','current','duration','tracks','volume','fullscreen'],
// Hide controls when playing and mouse is not over the video
alwaysShowControls: false,
// force iPad's native controls
iPadUseNativeControls: false,
// force iPhone's native controls
iPhoneUseNativeControls: false,
// force Android's native controls
AndroidUseNativeControls: false,
// forces the hour marker (##:00:00)
alwaysShowHours: false,
// show framecount in timecode (##:00:00:00)
showTimecodeFrameCount: false,
// used when showTimecodeFrameCount is set to true
framesPerSecond: 25,
// turns keyboard support on and off for this instance
enableKeyboard: true,
// when this player starts, it will pause other players
pauseOtherPlayers: true,
// array of keyboard commands
keyActions: []
});