一、修改HTML5模式下的logo
见http://blog.csdn.net/xiong_mao_1/article/details/17222757
二、修改FLASH模式下的logo
IE7/8下,会自动进入FLASH模式,此时,会自动搜索jwplayer.js所在目录下jwplayer.flash.swf文件。
所以,这次我们的目的就是修改swf文件。
环境准备:
flexsdk http://www.adobe.com/devnet/flex/flex-sdk-download.html
ant http://ant.apache.org/bindownload.cgi
项目源码 http://developer.longtailvideo.com/svn/tags/mediaplayer-6.7/
1、配置ant环境变量ANT_HOME
2、修改项目中 build/build.properties 文件
flexsdk = D:/flex_sdk ---注意是斜杠 '/'
execextension = .exe
flexsdk.target = 11.1
3、修改as文件---此处和别人又出入,请注意
①、PlayerVersion.as [mediaplayer-6.7\src\flash\com\longtailvideo\jwplayer\player目录下]
protected static var _version:String = "6.7.13.14"; //随便设置个版本号
②、RightclickMenu.as [mediaplayer-6.7\src\flash\com\longtailvideo\jwplayer\view目录下]
搜索关键字 "setAboutText"
修改内容,红色标示
protected function setAboutText():void {
about = new ContextMenuItem('About JW Player BY YCPANDA ...');
}
/** jump to the about page. **/
protected function aboutHandler(evt:ContextMenuEvent):void {
navigateToURL(new URLRequest('http://www.xx.com'), '_blank');
}
③、LogoComponent.as [mediaplayer-6.7\src\flash\com\longtailvideo\jwplayer\view\components目录下]
/** Configuration defaults **/
protected var defaults:Object = {
prefix: "http://xx.cn/images/",
file: "logo.png",
link: 'http://www.xx.com',
linktarget: "_blank",
margin: 8,
hide: false,
position: "top-right"
}
在LogoComponent(player:IPlayer)函数中,注释
//var linkFlag:String = _getLinkFlag(_getEdition());
//defaults.link = 'http://www.longtailvideo.com/jwpabout/?a=l&v='+PlayerVersion.version+'&m=f&e='+linkFlag,
在loadFile()函数中
defaults['file'] = prefix + getConfigParam('file');
//defaults['file'] = prefix + versionInfo[1] + "/" + versionInfo[2] + "/" + getConfigParam('file');
修改logo图片src的url组合方式
4、在项目根目录下,cmd中
执行 ant -buildfile build\build.xml
即生成 jwplayer.flash.swf.