mirror of
https://github.com/MoePlayer/DPlayer-Typecho.git
synced 2024-12-21 20:30:35 +08:00
Update dplayer to new version
This commit is contained in:
parent
8cd2f147c3
commit
c960560896
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1 @@
|
||||
/.idea/*
|
||||
/player/.git
|
||||
.idea
|
19
Plugin.php
19
Plugin.php
@ -44,7 +44,11 @@ class DPlayer_Plugin implements Typecho_Plugin_Interface
|
||||
*/
|
||||
public static function playerHeader()
|
||||
{
|
||||
echo '<script>var dPlayers = [];var dPlayerOptions = [];</script>';
|
||||
$url = Helper::options()->pluginUrl . '/DPlayer';
|
||||
echo <<<EOF
|
||||
<link rel="stylesheet" type="text/css" href="$url/dplayer/dist/DPlayer.min.css" />
|
||||
<script>var dPlayers = [];var dPlayerOptions = [];</script>
|
||||
EOF;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -54,18 +58,19 @@ class DPlayer_Plugin implements Typecho_Plugin_Interface
|
||||
{
|
||||
$url = Helper::options()->pluginUrl . '/DPlayer';
|
||||
if (Typecho_Widget::widget('Widget_Options')->plugin('DPlayer')->hls) {
|
||||
echo "<script type=\"text/javascript\" src=\"$url/plugin/hls.min.js\"></script>\n";
|
||||
echo "<script type=\"text/javascript\" src=\"$url/dplayer/plugin/hls.min.js\"></script>\n";
|
||||
}
|
||||
if (Typecho_Widget::widget('Widget_Options')->plugin('DPlayer')->flv) {
|
||||
echo "<script type=\"text/javascript\" src=\"$url/plugin/flv.min.js\"></script>\n";
|
||||
echo "<script type=\"text/javascript\" src=\"$url/dplayer/plugin/flv.min.js\"></script>\n";
|
||||
}
|
||||
echo <<<EOF
|
||||
<script type="text/javascript" src="$url/dist/DPlayer.min.js"></script>
|
||||
<script type="text/javascript" src="$url/dplayer/dist/DPlayer.min.js"></script>
|
||||
<script>
|
||||
var len = dPlayerOptions.length;
|
||||
for(var i=0;i<len;i++){
|
||||
dPlayers[i] = new DPlayer({
|
||||
element: document.getElementById('player' + dPlayerOptions[i]['id']),
|
||||
screenshot: false,
|
||||
autoplay: dPlayerOptions[i]['autoplay'],
|
||||
video: dPlayerOptions[i]['video'],
|
||||
theme: dPlayerOptions[i]['theme'],
|
||||
@ -152,7 +157,7 @@ EOF;
|
||||
);
|
||||
|
||||
if (isset($atts['addition'])) {
|
||||
$danmaku['addition'] = array($atts['addition']);
|
||||
$danmaku['addition'] = array($atts['addition']);
|
||||
}
|
||||
|
||||
$data['danmaku'] = (isset($atts['danmu']) && $atts['danmu'] == 'false') ? null : $danmaku;
|
||||
@ -172,8 +177,8 @@ EOF;
|
||||
$api = new Typecho_Widget_Helper_Form_Element_Text(
|
||||
'api', null, 'https://api.prprpr.me/dplayer/',
|
||||
_t('弹幕服务器地址'), _t('用于保存视频弹幕,默认为 https://api.prprpr.me/dplayer/'));
|
||||
$hls = new Typecho_Widget_Helper_Form_Element_Radio('hls',array('0' => _t('不开启HLS支持'),'1' => _t('开启HLS支持')),'0',_t('HLS支持'),_t("开启后可解析 m3u8 格式视频"));
|
||||
$flv = new Typecho_Widget_Helper_Form_Element_Radio('flv',array('0' => _t('不开启FLV支持'),'1' => _t('开启FLV支持')),'0',_t('FLV支持'),_t("开启后可解析 flv 格式视频"));
|
||||
$hls = new Typecho_Widget_Helper_Form_Element_Radio('hls', array('0' => _t('不开启HLS支持'), '1' => _t('开启HLS支持')), '0', _t('HLS支持'), _t("开启后可解析 m3u8 格式视频"));
|
||||
$flv = new Typecho_Widget_Helper_Form_Element_Radio('flv', array('0' => _t('不开启FLV支持'), '1' => _t('开启FLV支持')), '0', _t('FLV支持'), _t("开启后可解析 flv 格式视频"));
|
||||
$form->addInput($theme);
|
||||
$form->addInput($api);
|
||||
$form->addInput($hls);
|
||||
|
@ -1,9 +1,6 @@
|
||||
## DPlayer-for-typecho
|
||||
## DPlayer-Typecho
|
||||
[DPlayer](https://github.com/DIYgod/DPlayer) for typecho
|
||||
|
||||
### 声明
|
||||
部分代码参考 [https://github.com/zgq354/APlayer-Typecho-Plugin](https://github.com/zgq354/APlayer-Typecho-Plugin)
|
||||
|
||||
### 使用方式
|
||||
下载后将文件夹名改为DPlayer上传启用即可
|
||||
|
||||
|
4
dist/DPlayer.min.js
vendored
4
dist/DPlayer.min.js
vendored
File diff suppressed because one or more lines are too long
1
dist/DPlayer.min.js.map
vendored
1
dist/DPlayer.min.js.map
vendored
File diff suppressed because one or more lines are too long
2
dplayer/dist/DPlayer.min.css
vendored
Normal file
2
dplayer/dist/DPlayer.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dplayer/dist/DPlayer.min.css.map
vendored
Normal file
1
dplayer/dist/DPlayer.min.css.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","file":"DPlayer.min.css","sourceRoot":""}
|
2
dplayer/dist/DPlayer.min.js
vendored
Normal file
2
dplayer/dist/DPlayer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dplayer/dist/DPlayer.min.js.map
vendored
Normal file
1
dplayer/dist/DPlayer.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
7
dplayer/plugin/flv.min.js
vendored
Normal file
7
dplayer/plugin/flv.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
dplayer/plugin/hls.min.js
vendored
Normal file
7
dplayer/plugin/hls.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
plugin/flv.min.js
vendored
6
plugin/flv.min.js
vendored
File diff suppressed because one or more lines are too long
6
plugin/hls.min.js
vendored
6
plugin/hls.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user