Skip to content

Commit

Permalink
Fixed bilibili danmaku support
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueCocoa committed Nov 10, 2016
1 parent 3ad738e commit 7eae390
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Binary file modified dist/dplayer.zip
Binary file not shown.
5 changes: 3 additions & 2 deletions dplayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* Plugin Name: DPlayer for WordPress
* Description: Wow, such a lovely HTML5 danmaku video player comes to WordPress
* Version: 1.1.2
* Version: 1.1.3
* Author: 0xBBC
* Author URI: https://blog.0xbbc.com/
* License: GPLv3
Expand Down Expand Up @@ -76,7 +76,7 @@ public static function dplayer_load($atts = [], $content = null, $tag = '') {
if ($atts['screenshot']) $data['screenshot'] = ($atts['screenshot'] == 'true') ? true : false;
if ($atts['hotkey']) $data['hotkey'] = ($atts['hotkey'] == 'true') ? true : false;
if ($atts['preload']) $data['preload'] = (in_array($atts['preload'], array('auto', 'metadata', 'none')) == true) ? $atts['preload'] : 'metadata';
if ($atts['bilibili']) $data['addition'] = array(get_option( 'kblog_danmaku_url', '' ).'bilibili?aid='.$atts['bilibili']);


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

$js = json_encode($data);
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: 0xbbc
Tags: video, player, shortcode
Requires at least: 3.0.1
Tested up to: 4.6.1
Stable tag: 1.1.2
Stable tag: 1.1.3
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

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

== Changelog ==

= 1.1.3 =
* Fixed bilibili danmaku support

= 1.1.2 =
* Update DPlayer to version 1.1.2
* Add support for hls.min.js
Expand Down

0 comments on commit 7eae390

Please sign in to comment.