跑马灯功能
启用时在配置中添加插件名称 Marquee ,参数如下:
| 参数 | 描述 | 
|---|---|
| data | 数组类型,可添加多个跑马灯。值为object类型 | 
启用时各个data参数如下:
| 参数 | 描述 | 
|---|---|
| name | 名称参数:String | 
| loopTime | 循环次数,参数:int -1为无限循环。大于1为循环次数。 | 
| type | 跑马灯类型参数:String ‘text’=文本类型。’image’=图片类型。当类型为文本时字体样式设置才会生效。同理图片类型。 | 
| text | 文本类型下文本内容类型:String | 
| size | 文本类型下字体的大小类型:uint | 
| color | 文本类型下的字体颜色类型:String 值为颜色值转换成字符串 | 
| url | 图片类型下图像的url 类型:String | 
| width | 图片类型下图像的宽 | 
| height | 图片类型下图像的高 | 
| actions | 运动动画 类型数组,参数如下示例:index:运动顺序,duration:运动时间 start开始状态 end结束状态 xpos x位置(参数为画面百分比)ypos y位置 alpha 透明信息 [{index:0,duration:3000,start:{xpos:0.112,ypos:0.123,alhpa:1},end{xpos:0.812,ypos:0.823,alpha},{index:0,duration:3000,start:{xpos:0.112,ypos:0.123,alhpa:1},end{xpos:0.812,ypos:0.823,alpha}}] | 
跑马灯插件启用后还开放有如下接口:
| 接口 | 说明 | 
|---|---|
| addTextItem(name,text,size,color,font,actions,loopTime) | 添加文本类型跑马灯。 | 
| addImageItem(name,url,width,height,actions,loopTime) | 添加图片类型跑马灯。 | 
| removeItem(name) | 移除某一个跑马灯 | 
使用跑马灯插件时,需了解此插件仅提供了把文字渲染至视频画面上(包括滚动和排列)的功能。
代码示例如下:
functioncustomFullScreen(){
//TODO 自定义全屏
}
functiononPlayPaused(){
// 已暂停播放
}
functionon_cc_player_init( vid, swfID ){
var config = {
};
             config.player_plugins = {
Marquee:{  
                                      data:[
                                                  {
                                                    name:"11",
                                                   type:"text",  
                                                   text:"helloworld",
                                                   font:"微软雅黑",  
                                                   size:20,
                                                   color:"0xFF0000",
                                                   loopTime:30000,
                                                  actions:[
                                                                {
                                                                     index:0,  
                                                                     duration:30000,  
                                                                     start:{
                                                                             xpos:0.112,  
                                                                             ypos:0.123,  
                                                                             alpha:1
                                                                      },  
                                                                     end:{
                                                                              xpos:0.812,  
                                                                              ypos:0.823,
                                                                              alpha:1
                                                                       }  
                                                                }
                                                       ]
                                               }
                                          ]
                                    }
                 };
var player = getSWF(swfID);
player.setConfig( config );
}
functiongetSWF( swfID ) {
if( window.document[ swfID ] ) {
returnwindow.document[ swfID ];
} elseif( navigator.appName.indexOf( "Microsoft" ) == -1 ) {
if( document.embeds && document.embeds[ swfID ] ) {
returndocument.embeds[ swfID ];
}
} else {
returndocument.getElementById( swfID );
}
}
 
           
              
              
              
