私は以下のコードを持っています:
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "http://test.captive-portal.com/jwplayer/player.swf",
file: "http://content.captive-portal.com/files/video/cirque-du-soleil/mob.mp4",
image: "http://content.captive-portal.com/files/video/cirque-du-soleil/mob.jpg",
height: 285,
width: 480,
});
</script>
ページ全体はここにあります (必要な場合に備えて): video page。
私がやろうとしているのは、ウィンドウの解像度に応じて、file: (...)、image (...)、height(...)、width (...) の 4 行を変更することです。私はcssでこれを行うことができたので、スタイルは正しく適用されますが、これはjavascriptであり、変更方法がよくわかりません. 1 つのページに 2 つの同様のスクリプトを div に配置し、大きな画面の場合は小さなスクリプトを非表示にするか、小さな画面の場合は大きなスクリプトを非表示にしようとしましたが、うまくいきませんでした。ビデオが再生されませんでした。これは、Flash Player ファイル内のいくつかのスクリプトが原因である可能性があります。
画面の解像度に応じて、これらの 4 行の条件を設定する方法はありますか? よろしくお願いいたします。