我對這一切都很陌生,無法弄清楚在調整窗口大小或方向更改時如何調整我用於家庭媒體服務器的Flash播放器的大小。我將玩家大小視爲視口的大小。我已經搜索並嘗試了各種版本,但他們不工作,這很可能是由於我缺乏知識。 下面的大部分代碼已經完成了,我已經評論了我在這裏添加的內容以供參考。用於flash播放器的視口大小調整事件
viewport.js(由我添加)
var width = $(window).width();
var height = $(window).height();
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Gizmo play_flash</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<script type="text/javascript" src="scripts/jwplayer.js"></script>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript" src="scripts/viewport.js"></script>
<noscript><meta http-equiv="refresh" content="2; URL=noscript.html"></noscript>
</head>
<body style="margin: 0; padding: 0; background-color: #000000">
<div id="outer">
<div class="player_wrapper" style="width: 100%; height: 100%; margin:0px auto;">
<div id="player">
Loading the video player ...
</div>
</div>
<script type="text/javascript">
jwplayer('player').setup({
'flashplayer': 'scripts/player.swf',
'file': '[File.FlashLink]',
'autostart': 'true',
'duration': '[File.Duration]',
'provider': 'scripts/jrmediaprovider.swf',
'skin': 'scripts/glow.zip',
<!--begin mod-->
'width': width - 5,
'height': height - 5
<!--endmod-->
});
jwplayer('player').onComplete(
function(event) {
try {
window.Gizmo.onComplete();
} catch (err) { }
}
);
</script>
</div>
</body>
</html>
我花了幾天現在正在尋找一個解決這個問題。不幸的是,在移動設備上無法實現這一點,請參閱:http://quirksmode.org/dom/events/resize_mobile.html – 2014-10-31 03:04:15