Skip to content

Commit 7eae390

Browse files
committed
Fixed bilibili danmaku support
1 parent 3ad738e commit 7eae390

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

dist/dplayer.zip

11 Bytes
Binary file not shown.

dplayer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* Plugin Name: DPlayer for WordPress
44
* Description: Wow, such a lovely HTML5 danmaku video player comes to WordPress
5-
* Version: 1.1.2
5+
* Version: 1.1.3
66
* Author: 0xBBC
77
* Author URI: https://blog.0xbbc.com/
88
* License: GPLv3
@@ -76,7 +76,7 @@ public static function dplayer_load($atts = [], $content = null, $tag = '') {
7676
if ($atts['screenshot']) $data['screenshot'] = ($atts['screenshot'] == 'true') ? true : false;
7777
if ($atts['hotkey']) $data['hotkey'] = ($atts['hotkey'] == 'true') ? true : false;
7878
if ($atts['preload']) $data['preload'] = (in_array($atts['preload'], array('auto', 'metadata', 'none')) == true) ? $atts['preload'] : 'metadata';
79-
if ($atts['bilibili']) $data['addition'] = array(get_option( 'kblog_danmaku_url', '' ).'bilibili?aid='.$atts['bilibili']);
79+
8080

8181
$playerCode = '<div id="player'.$id.'" class="dplayer">';
8282
$playerCode .= "</div>\n";
@@ -87,6 +87,7 @@ public static function dplayer_load($atts = [], $content = null, $tag = '') {
8787
'token' => get_option( 'kblog_danmaku_token', '' ),
8888
'api' => get_option( 'kblog_danmaku_url', '' ),
8989
);
90+
if ($atts['bilibili']) $danmaku['addition'] = array(get_option( 'kblog_danmaku_url', '' ).'bilibili?aid='.$atts['bilibili']);
9091
$data['danmaku'] = ($atts['danmu'] != 'false') ? $danmaku : null;
9192

9293
$js = json_encode($data);

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: 0xbbc
33
Tags: video, player, shortcode
44
Requires at least: 3.0.1
55
Tested up to: 4.6.1
6-
Stable tag: 1.1.2
6+
Stable tag: 1.1.3
77
License: GPLv3
88
License URI: http://www.gnu.org/licenses/gpl-3.0.html
99

@@ -39,6 +39,9 @@ Parameter 'danmu', should DPlayer load danmaku. Default false and it's optional.
3939

4040
== Changelog ==
4141

42+
= 1.1.3 =
43+
* Fixed bilibili danmaku support
44+
4245
= 1.1.2 =
4346
* Update DPlayer to version 1.1.2
4447
* Add support for hls.min.js

0 commit comments

Comments
 (0)