0

次のサーバー側のビデオクリップ変数があります。$fileName = "bin-debug/Video Source/Black Eyed Peas - The Time.flv";次のJavascriptを使用して、このビデオクリップでプレーヤーを作成しています(Flexビデオコンポーネントを使用しています)

function createPlayer(videoSource){
    document.writeln("<div id=\"player\">");
    document.writeln("<object width=\"489\" height=\"414\" FlashVars=\""+videoSource+"\">");
    document.writeln("<param name=\"player\" value=\"bin-debug/FlexPlayer.swf\">");
    document.writeln("<embed src=\"bin-debug/FlexPlayer.swf\" name=\"player\" width=\"489\" height=\"414\" FlashVars=\""+videoSource+"\">");
    document.writeln("</embed>");
    document.writeln("</object>");
    document.writeln("</div>");               
}

関数呼び出しは次のようなものです

<script type="text/javascript">
var videoSource = "<?php echo $fileName; ?>";
    createPlayer(videoSource);
</script>

何らかの理由で、プレーヤーは別のビデオを再生していません。おそらく問題は、videoSourcewタグが指定されているMXMLにありますか?どんな助けでも大歓迎です。

4

1 に答える 1

1

多分このように

document.writeln("<param name=FlashVars value="+videoSource+">");

編集

次に、FlashVarsパラメータを定義しましたが、埋め込みでは呼び出されません

height = \"414\"の後に埋め込みにこれを追加します

FlashVars=\""+videoSource+"\"

この結果のために

document.writeln("<embed src=\"bin-debug/FlexPlayer.swf\" name=\"player\" width=\"489\" height=\"414\" FlashVars=\""+videoSource+"\">");
于 2011-07-24T18:04:06.583 に答える