嵌入在网站上Flash播放机(2)

嵌入在网站上Flash播放机(2)

大家好,又见面了,我是全栈君,今天给大家准备了Idea注册码。

      然后在一个博客。这里有一个flash嵌入式播放器。这是公司内部使用的flash播放机,支持格更多款式,同时支持swf格视频播放的类型。

以下是页面嵌入代码:

<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/flash/history/history.css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/flash/history/history.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/flash/swfobject.js"></script>

<script type="text/javascript">
    // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. 
    var swfVersionStr = "11.1.0";
    // To use express install, set to playerProductInstall.swf, otherwise the empty string. 
    var xiSwfUrlStr = "playerProductInstall.swf";
    var flashvars = {};
    //资源前置路径,为要载入flash的路径,比如:http://demo.com/assets/flash/
    var assetPath = "<%=request.getContextPath()%>/flash/";//配置资源路径
    flashvars.url='<c:out value="${generateSwfUrl}"/>';//视频播放路径,能够动态赋值
    flashvars.duration=${duration};//视频时长。能够动态赋值
    var params = {};
    params.quality = "high";
    params.bgcolor = "#000000";
    params.allowscriptaccess = "sameDomain";
    params.allowfullscreen = "true";
    params.wmode= "transparent";
    var attributes = {};
    attributes.id = "VideoPreviewer";
    attributes.name = "VideoPreviewer";
    attributes.align = "middle";

    //防缓存
    var d = new Date();
    flashvars.time = d.getTime();
	
    var preloaderUrl = assetPath + "VideoPreviewer.swf" + "?time=" + flashvars.time;//preloader.swf
    swfobject.embedSWF(
	preloaderUrl, "flashContent", 
	"380", "290", 
	swfVersionStr, xiSwfUrlStr, 
	flashvars, params, attributes);
    // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
    swfobject.createCSS("#flashContent", "display:block;text-align:left;");
</script>

<div class="publish_video">
	<center style="position: relative; top:0px; left:0px;  margin:0px; padding:0px; background:#000000; overflow: hidden; ">
	<div id="flashContent" style="position: relative; top:0px; left:0px;  margin:0px; padding:0px;">
		<p>To view this page ensure that Adobe Flash Player version 11.1.0 or greater is installed.</p>
		<script type="text/javascript"> 
			var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://"); 
			document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
			+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
		</script>
	</div>

	<noscript>
		<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			width="390px" height="390px" id="VideoPreviewer">
			<param name="movie" value="VideoPreviewer.swf" />
			<param name="quality" value="high" />
			<param name="bgcolor" value="#ffffff" />
			<param name="allowScriptAccess" value="sameDomain" />
			<param name="allowFullScreen" value="true" />
			<!--[if !IE]>-->
			<object type="application/x-shockwave-flash"
				data="VideoPreviewer.swf" width="370px" height="277px">
				<param name="quality" value="high" />
				<param name="bgcolor" value="#ffffff" />
				<param name="allowScriptAccess" value="sameDomain" />
				<param name="allowFullScreen" value="true" />
				<!--<![endif]-->
				<!--[if gte IE 6]>-->
				<p>
					Either scripts and active content are not permitted to run
					or Adobe Flash Player version 11.1.0 or greater is not installed.
				</p>
				<!--<![endif]-->
				<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>
				<!--[if !IE]>-->
			</object>
			<!--<![endif]-->
		</object>
	</noscript>
</center>
</div>

备注:这仅仅是页面的嵌入代码,他还须要一些资源文件。我将须要的全部资源文件作为demo放在目录里打包上传到空间里了。



下载地址:http://download.csdn.net/detail/smszhuang168/7689225

总结:flash的嵌入方式事实上都差点儿相同,无非就是用js动态传入一些參数而已,基本的代码在flash对像巷,在网页代码基本上几乎相同的。

版权声明:本文博客原创文章,博客,未经同意,不得转载。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/117443.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Raspberry Pi (树莓派)折腾记之一

    Raspberry Pi (树莓派)折腾记之一那么什么是RaspberryPi?RaspberryPi是一款针对电脑业余爱好者、教师、小学生以及小型企业等用户的迷你电脑,预装Linux系统,体积仅信用卡大小,搭载ARM架构处理器,运算性能和智能手机相仿。在接口方面,RaspberryPi提供了可供键鼠使用的USB接口,此外还有快速以太网接口、SD卡扩展接口以及1个HDMI高清视频输出接口,可与显示器或者TV…

    2025年5月23日
    1
  • 动漫推荐新番_有深度的番剧

    动漫推荐新番_有深度的番剧已搬迁至"github平台",此处不再更新!!!版权所有,不允许转载,图片侵删按喜欢的顺序递减排列命运石之门科幻/剧情/爱情【内容介绍】“这一切都是命运石之门的选择

    2022年8月1日
    5
  • android一键换手机,不同品牌手机一键换机:换新手机怎么转移数据?「建议收藏」

    android一键换手机,不同品牌手机一键换机:换新手机怎么转移数据?「建议收藏」我们正处于一个数码产品更新换代非常快速的时代,很多消费者会紧跟时代潮流,经常更换新手机,但是更换手机之后我们通常需要将旧手机里的数据进行转移,不同品牌之间的手机怎么进行一键换机呢?以安卓手机更换苹果手机转移数据为例:1、首先我们需要在安卓手机上安装“转移到iOS”APP,通过该应用我们可以将安卓手机的数据转移到新的苹果手机上2、确保安卓设备处于WiFi状态3、将安卓设备以及苹果设备连接电源4、设置…

    2022年5月26日
    101
  • 使用bootbox.js(二级务必提交书面和数字到数字中国)

    使用bootbox.js(二级务必提交书面和数字到数字中国)

    2022年1月3日
    39
  • 【转载】序列化和反序列化

    【转载】序列化和反序列化

    2021年11月18日
    40
  • 什么是波特率,波特率怎么计算[通俗易懂]

    什么是波特率,波特率怎么计算[通俗易懂]✍什么是波特率,波特率怎么计算➹概述:  ☆简而言之,串口传输的波特率即为每秒钟传输二进制的位数。  ☆脱离枯燥乏味的文字描述,我们用波形和数字来看看波特率是什么吧☟。  ☆说明:系统时钟50M,波特率115200。  基础知识:因果系统时钟-50M时钟周期150∗106{{\rm{1}}\over{{\rm{50*1}}{{\rm{0}}^{\rm{6}}}}}50∗1061​假设1个时钟周期可以计数1次(其实FPGA就是这样)50M时钟1s计数5000

    2022年4月20日
    96

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号