我使用php、javascript和html/css在工具提示上显示flv文件。但是,在第一个flv之后,其他flv显示为“此内容需要Adobe Flash Player”。消息。
PHP:
$tooltip .= "
<script type=\"text/javascript\">
var playervars = {
contentpath: '',
video: \"$url\",
preview: \"demo-preview.jpg\",
skin: \"skin-applestyle.swf\",
skincolor: \"0x2c8cbd\"
// ...
//see documentation for all the parameters
};
var params = { scale: \"scale\", allowfullscreen: \"true\", salign: \"tl\", bgcolor: \"#ffffff\", play: \"true\" };
var attributes = { align: \"left\", base: \".\" };
swfobject.embedSWF(\"../media/flvplayer/flvplayer.swf\", \"videoCanvas\", \"256\", \"210\", \"9.0.28\", \"../flvplayer/expressInstall.swf\", playervars, params, attributes);
</script>
<div id=\"videoCanvas\" style=\"margin:0px;visbility:visible;\">
<p>This content requires the Adobe Flash Player.</p>
<p><a href=\"http://www.adobe.com/go/getflashplayer\"><img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" /></a>
</p>
</div>
";HTML:
<div class="thetooltip"><img src="/images/icon.png" alt="questions" width="12" height="12" border="0" />
<span>
<?php echo $tooltip; ?>
</span>
</div>我使用工具提示的纯css方法,跨度是在工具提示上显示的视频。
正如我所说的,第一个工具提示弹出并完美地播放视频,之后的每个flv都会显示adobe错误。
发布于 2011-02-04 05:19:52
你仍然有这个问题吗?这是我发现的。
根据这里的一些文档,http://code.google.com/p/swfobject/wiki/documentation,在这一行:
swfobject.embedSWF(\"../media/flvplayer/flvplayer.swf\", \"videoCanvas\", \"256\", \"210\", \"9.0.28\", \"../flvplayer/expressInstall.swf\", playervars, params, attributes);\"videoCanvas\"部分指的是要替换成视频的对象的ID。执行第一个工具提示时,将在页面上创建<div id=\"videoCanvas\"。但是,我怀疑当工具提示消失时,它可能不会被销毁。因此,当下一个div尝试加载时,文档中有多个包含id=videoCanvas的div。ID必须是唯一的,否则需要在工具提示关闭后将div从文档中完全删除。
https://stackoverflow.com/questions/4887144
复制相似问题