20 Star 29 Fork 10

Zhang Di / yii-web-player

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
VideoPlayer.php 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
<?php
/**
* VideoPlayer.php
*
* @author Di Zhang <zhangdi_me@163.com>
*/
require(dirname(__FILE__) . '/BasePlayer.php');
/**
* Class VideoPlayer
*
* 通用视频播放器,适用于优酷,搜狐,土豆等
*
*/
class VideoPlayer extends BasePlayer
{
public $defaultOptions = array(
'allowFullScreen' => 'true',
'allowScriptAccess' => 'always',
'wmode' => 'transparent',
'quality' => 'high',
'autoplay' => 'false',
'vars' => '',
'mode' => 'transparent'
);
public function init()
{
parent::init();
echo CHtml::openTag('object', array('width' => $this->width, 'height' => $this->height));
echo CHtml::tag('param', array('name' => 'movie', 'value' => $this->url));
$options = CMap::mergeArray($this->defaultOptions, $this->options);
foreach ($options as $name => $value) {
echo CHtml::tag('param', array('name' => $name, 'value' => $value));
}
echo CHtml::tag('embed', CMap::mergeArray($options, array(
'src' => $this->url,
'width' => $this->width,
'height' => $this->height,
'type' => "application/x-shockwave-flash"
)));
}
public function run()
{
echo CHtml::closeTag('object');
}
}
PHP
1
https://gitee.com/dizhang/yii-web-player.git
git@gitee.com:dizhang/yii-web-player.git
dizhang
yii-web-player
yii-web-player
master

搜索帮助