Changeset 1956902
- Timestamp:
- 10/15/2018 01:42:58 PM (7 years ago)
- Location:
- dplayer-for-wp
- Files:
-
- 9 added
- 3 edited
-
tags/1.2.3 (added)
-
tags/1.2.3/dplayer (added)
-
tags/1.2.3/dplayer-admin.php (added)
-
tags/1.2.3/dplayer.php (added)
-
tags/1.2.3/dplayer/init-dplayer.js (added)
-
tags/1.2.3/dplayer/plugin (added)
-
tags/1.2.3/dplayer/plugin/flv.min.js (added)
-
tags/1.2.3/dplayer/plugin/hls.min.js (added)
-
tags/1.2.3/readme.txt (added)
-
trunk/dplayer.php (modified) (5 diffs)
-
trunk/dplayer/init-dplayer.js (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dplayer-for-wp/trunk/dplayer.php
r1718543 r1956902 3 3 * Plugin Name: DPlayer for WordPress 4 4 * Description: Wow, such a lovely HTML5 danmaku video player comes to WordPress 5 * Version: 1.2. 25 * Version: 1.2.3 6 6 * Author: 0xBBC 7 7 * Author URI: https://blog.0xbbc.com/ … … 41 41 add_option( 'kblog_danmaku_url', '//danmaku.daoapp.io' ); 42 42 add_option( 'kblog_danmaku_token', 'tokendemo' ); 43 add_option( 'kblog_danmaku_dplayer_version', '1. 6.1' );43 add_option( 'kblog_danmaku_dplayer_version', '1.25.0' ); 44 44 add_option( 'kblog_danmaku_dplayer_version_check', '0' ); 45 45 } … … 105 105 $bilibili_param = $atts['bilibili'] ? $atts['bilibili'] : ''; 106 106 $id = md5($_SERVER['HTTP_HOST'] . $atts['url'] . $bilibili_param); 107 $result = array(108 'url' => $atts['url'] ? $atts['url'] : '',109 'pic' => $atts['pic'] ? $atts['pic'] : '',110 'type' => $atts['type'] ? $atts['type'] : 'auto',111 );112 107 113 $theme = $atts['theme'];114 if (!$theme) $theme = '#FADFA3';115 116 108 $data = array( 117 109 'id' => $id, 118 110 'autoplay' => false, 119 'theme' => $ theme,111 'theme' => $atts['theme'] ? $atts['theme'] : '#FADFA3', 120 112 'loop' => false, 121 113 'screenshot' => false, 122 114 'hotkey' => true, 123 'preload' => 'metadata' 124 ); 125 115 'preload' => 'metadata', 116 'lang' => $atts['lang'] ? $atts['lang'] : 'zh-cn', 117 'logo' => $atts['logo'] ? $atts['logo'] : null, 118 'volume' => $atts['volume'] ? $atts['volume'] : 0.7, 119 'mutex' => true, 120 ); 126 121 if ($atts['autoplay']) $data['autoplay'] = ($atts['autoplay'] == 'true') ? true : false; 127 122 if ($atts['loop']) $data['loop'] = ($atts['loop'] == 'true') ? true : false; … … 129 124 if ($atts['hotkey']) $data['hotkey'] = ($atts['hotkey'] == 'true') ? true : false; 130 125 if ($atts['preload']) $data['preload'] = (in_array($atts['preload'], array('auto', 'metadata', 'none')) == true) ? $atts['preload'] : 'metadata'; 131 132 126 if ($atts['mutex']) $data['mutex'] = ($atts['mutex'] == 'true') ? true : false; 127 128 $video = array( 129 'url' => $atts['url'] ? $atts['url'] : '', 130 'pic' => $atts['pic'] ? $atts['pic'] : '', 131 'type' => $atts['type'] ? $atts['type'] : 'auto', 132 'thumbnails' => $atts['thumbnails'] ? $atts['thumbnails'] : '', 133 ); 134 135 $subtitle = array( 136 'url' => $atts['subtitleurl'] ? $atts['subtitleurl'] : '', 137 'type' => $atts['subtitletype'] ? $atts['subtitletype'] : 'webvtt', 138 'fontSize' => $atts['subtitlefontSize'] ? $atts['subtitlefontSize'] : '25px', 139 'bottom' => $atts['subtitlebottom'] ? $atts['subtitlebottom'] : '10%', 140 'color' => $atts['subtitlecolor'] ? $atts['subtitlecolor'] : '#b7daff', 141 ); 142 143 $danmaku = array( 144 'id' => md5($id), 145 'api' => get_option( 'kblog_danmaku_url', '' ), 146 'token' => get_option( 'kblog_danmaku_token', '' ), 147 'maximum' => $atts['maximum'] ? $atts['maximum'] : 1000, 148 'addition' => $atts['addition'] ? explode('-A-', $atts['addition']) : [], 149 'user' => $atts['user'] ? $atts['user'] : 'DIYgod', 150 'bottom' => $atts['bottom'] ? $atts['bottom'] : '15%', 151 'unlimited' => true, 152 ); 153 if ($atts['unlimited']) $data['unlimited'] = ($atts['unlimited'] == 'true') ? true : false; 154 133 155 $playerCode = '<div id="player'.$id.'" class="dplayer">'; 134 156 $playerCode .= "</div>\n"; 135 157 136 $danmaku = array(137 'id' => md5($id),138 'token' => get_option( 'kblog_danmaku_token', '' ),139 'api' => get_option( 'kblog_danmaku_url', '' ),140 );141 142 158 if ($bilibili_param) { 143 159 $bilibili_parsed = DPlayer::dplayer_bilibili_url_handler($bilibili_param); 144 160 $danmaku['addition'] = array($bilibili_parsed['danma']); 145 161 if ($danmaku['addition'] && empty($atts['url'])) { 146 $ result['url'] = $bilibili_parsed['video'];162 $video['url'] = $bilibili_parsed['video']; 147 163 } 148 164 } 149 165 150 $data['video'] = $result; 166 $data['video'] = $video; 167 $data['subtitle'] = $subtitle; 151 168 $data['danmaku'] = ($atts['danmu'] != 'false') ? $danmaku : null; 152 169 … … 177 194 $current_time = time(); 178 195 $last_check = (int)get_option( 'kblog_danmaku_dplayer_version_check', '0' ); 179 $dplayer_version = get_option( 'kblog_danmaku_dplayer_version', '1. 6.1' );196 $dplayer_version = get_option( 'kblog_danmaku_dplayer_version', '1.25.0' ); 180 197 181 198 if ($current_time - $last_check > 86400 /* 86400 = 60 * 60 * 24 i.e 24hrs */) { -
dplayer-for-wp/trunk/dplayer/init-dplayer.js
r1694437 r1956902 1 1 var len = dPlayerOptions.length; 2 for (var i=0;i<len;i++){2 for (var i = 0; i < len; i++) { 3 3 dPlayers[i] = new DPlayer({ 4 element: document.getElementById('player' + dPlayerOptions[i]['id']), 5 autoplay: dPlayerOptions[i]['autoplay'], 6 video: dPlayerOptions[i]['video'], 7 theme: dPlayerOptions[i]['theme'], 8 danmaku: dPlayerOptions[i]['danmaku'], 4 container: document.getElementById('player' + dPlayerOptions[i]['id']), 5 autoplay: dPlayerOptions[i]['autoplay'], 6 theme: dPlayerOptions[i]['theme'], 7 loop: dPlayerOptions[i]['loop'], 8 lang: dPlayerOptions[i]['lang'], 9 screenshot: dPlayerOptions[i]['screenshot'], 10 hotkey: dPlayerOptions[i]['hotkey'], 11 preload: dPlayerOptions[i]['preload'], 12 logo: dPlayerOptions[i]['logo'], 13 volume: dPlayerOptions[i]['volume'], 14 mutex: dPlayerOptions[i]['mutex'], 15 video: dPlayerOptions[i]['video'], 16 subtitle: dPlayerOptions[i]['subtitle'], 17 danmaku: dPlayerOptions[i]['danmaku'], 9 18 }); 10 19 } 11 -
dplayer-for-wp/trunk/readme.txt
r1718543 r1956902 3 3 Tags: video, player, shortcode 4 4 Requires at least: 3.0.1 5 Tested up to: 4. 8.16 Stable tag: 1.2. 25 Tested up to: 4.9.8 6 Stable tag: 1.2.3 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 39 39 40 40 == Changelog == 41 42 = 1.2.3 = 43 boost to DPlayer 1.25.0 41 44 42 45 = 1.2.2 =
Note: See TracChangeset
for help on using the changeset viewer.