Changeset 1534780
- Timestamp:
- 11/16/2016 04:30:17 AM (9 years ago)
- Location:
- dplayer-for-wp
- Files:
-
- 2 edited
- 7 copied
-
tags/1.1.4 (copied) (copied from dplayer-for-wp/trunk)
-
tags/1.1.4/dplayer-admin.php (copied) (copied from dplayer-for-wp/trunk/dplayer-admin.php)
-
tags/1.1.4/dplayer.php (copied) (copied from dplayer-for-wp/trunk/dplayer.php) (3 diffs)
-
tags/1.1.4/js/DPlayer.min.js (copied) (copied from dplayer-for-wp/trunk/js/DPlayer.min.js)
-
tags/1.1.4/js/DPlayer.min.js.map (copied) (copied from dplayer-for-wp/trunk/js/DPlayer.min.js.map)
-
tags/1.1.4/js/plugin (copied) (copied from dplayer-for-wp/trunk/js/plugin)
-
tags/1.1.4/readme.txt (copied) (copied from dplayer-for-wp/trunk/readme.txt) (3 diffs)
-
trunk/dplayer.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dplayer-for-wp/tags/1.1.4/dplayer.php
r1531408 r1534780 3 3 * Plugin Name: DPlayer for WordPress 4 4 * Description: Wow, such a lovely HTML5 danmaku video player comes to WordPress 5 * Version: 1.1. 35 * Version: 1.1.4 6 6 * Author: 0xBBC 7 7 * Author URI: https://blog.0xbbc.com/ … … 48 48 } 49 49 50 public static function dplayer_bilibili_url_handler($bilibili_url) { 51 $aid = 0; 52 $page = 1; 53 $is_bilibili = false; 54 if (preg_match('/^[\d]+$/', $bilibili_url)) { 55 $aid = $bilibili_url; 56 $is_bilibili = true; 57 } else { 58 $parsed = parse_url($bilibili_url); 59 if ($parsed['host'] === 'www.bilibili.com') { 60 preg_match('/^\/video\/av([\d]+)(?:\/index_([\d]+)\.html)?/', $parsed['path'], $path_match); 61 if ($path_match) { 62 $is_bilibili = true; 63 $aid = $path_match[1]; 64 $page = $path_match[2] == null ? 1 : $path_match[2]; 65 preg_match('/^page=([\d]+)$/', $parsed['fragment'], $page_match); 66 if ($page_match) $page = $page_match[1]; 67 } 68 } 69 } 70 71 if ($is_bilibili) { 72 if ($page == 1) { 73 return array(get_option( 'kblog_danmaku_url', '' ).'bilibili?aid='.$aid); 74 } else { 75 $cid = -1; 76 $json_response = @json_decode(gzdecode(file_get_contents('http://www.bilibili.com/widget/getPageList?aid='.$aid)), true); 77 if ($json_response) { 78 foreach ($json_response as $page_info) { 79 if ($page_info['page'] == $page) { 80 $cid = $page_info['cid']; 81 break; 82 } 83 } 84 } 85 86 if ($cid != -1) { 87 return array(get_option( 'kblog_danmaku_url', '' ).'bilibili?cid='.$cid); 88 } 89 } 90 } 91 return null; 92 } 93 50 94 public static function dplayer_load($atts = [], $content = null, $tag = '') { 51 95 // normalize attribute keys, lowercase … … 88 132 'api' => get_option( 'kblog_danmaku_url', '' ), 89 133 ); 90 if ($atts['bilibili']) $danmaku['addition'] = array(get_option( 'kblog_danmaku_url', '' ).'bilibili?aid='.$atts['bilibili']); 134 135 if ($atts['bilibili']) $danmaku['addition'] = DPlayer::dplayer_bilibili_url_handler($atts['bilibili']); 91 136 $data['danmaku'] = ($atts['danmu'] != 'false') ? $danmaku : null; 92 137 -
dplayer-for-wp/tags/1.1.4/readme.txt
r1531408 r1534780 4 4 Requires at least: 3.0.1 5 5 Tested up to: 4.6.1 6 Stable tag: 1.1. 36 Stable tag: 1.1.4 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 23 23 Parameter 'preload', preload mode, 'auto', 'metatdata' or 'none'. Optional and default metadata. 24 24 Parameter 'hotkey', enable builtin hotkey? including left, right and Space. Optional and default true. 25 Parameter 'bilibili', bilibili视频AV号 . Additional danmaku from bilibili25 Parameter 'bilibili', bilibili视频AV号 或者 完整的bilibili视频链接. Additional danmaku from bilibili 26 26 Parameter 'danmu', should DPlayer load danmaku. Default false and it's optional. 27 27 … … 39 39 40 40 == Changelog == 41 42 = 1.1.4 = 43 * Extended support for bilibili param, now you can use either 44 - bilibili='23333' 45 - bilibili='http://www.bilibili.com/video/av2333333/index_233.html#page=2333' 46 to load additional danmaku. 47 48 This plugin will give you exactly the danma that you need, which means, 49 50 If you give the original URL to the bilibili video, this plugin will identify the URL format, load the right danmaku. In this example, 'http://www.bilibili.com/video/av2333333/index_23333#page=233' is given. And the plugin knows that aid is 2333333 and your requested page is 2333. (According to bilibili, 'index_233.html#page=2333' means that you starts at page 233 but currently you're watching page 2333) 41 51 42 52 = 1.1.3 = -
dplayer-for-wp/trunk/dplayer.php
r1531408 r1534780 3 3 * Plugin Name: DPlayer for WordPress 4 4 * Description: Wow, such a lovely HTML5 danmaku video player comes to WordPress 5 * Version: 1.1. 35 * Version: 1.1.4 6 6 * Author: 0xBBC 7 7 * Author URI: https://blog.0xbbc.com/ … … 48 48 } 49 49 50 public static function dplayer_bilibili_url_handler($bilibili_url) { 51 $aid = 0; 52 $page = 1; 53 $is_bilibili = false; 54 if (preg_match('/^[\d]+$/', $bilibili_url)) { 55 $aid = $bilibili_url; 56 $is_bilibili = true; 57 } else { 58 $parsed = parse_url($bilibili_url); 59 if ($parsed['host'] === 'www.bilibili.com') { 60 preg_match('/^\/video\/av([\d]+)(?:\/index_([\d]+)\.html)?/', $parsed['path'], $path_match); 61 if ($path_match) { 62 $is_bilibili = true; 63 $aid = $path_match[1]; 64 $page = $path_match[2] == null ? 1 : $path_match[2]; 65 preg_match('/^page=([\d]+)$/', $parsed['fragment'], $page_match); 66 if ($page_match) $page = $page_match[1]; 67 } 68 } 69 } 70 71 if ($is_bilibili) { 72 if ($page == 1) { 73 return array(get_option( 'kblog_danmaku_url', '' ).'bilibili?aid='.$aid); 74 } else { 75 $cid = -1; 76 $json_response = @json_decode(gzdecode(file_get_contents('http://www.bilibili.com/widget/getPageList?aid='.$aid)), true); 77 if ($json_response) { 78 foreach ($json_response as $page_info) { 79 if ($page_info['page'] == $page) { 80 $cid = $page_info['cid']; 81 break; 82 } 83 } 84 } 85 86 if ($cid != -1) { 87 return array(get_option( 'kblog_danmaku_url', '' ).'bilibili?cid='.$cid); 88 } 89 } 90 } 91 return null; 92 } 93 50 94 public static function dplayer_load($atts = [], $content = null, $tag = '') { 51 95 // normalize attribute keys, lowercase … … 88 132 'api' => get_option( 'kblog_danmaku_url', '' ), 89 133 ); 90 if ($atts['bilibili']) $danmaku['addition'] = array(get_option( 'kblog_danmaku_url', '' ).'bilibili?aid='.$atts['bilibili']); 134 135 if ($atts['bilibili']) $danmaku['addition'] = DPlayer::dplayer_bilibili_url_handler($atts['bilibili']); 91 136 $data['danmaku'] = ($atts['danmu'] != 'false') ? $danmaku : null; 92 137 -
dplayer-for-wp/trunk/readme.txt
r1531408 r1534780 4 4 Requires at least: 3.0.1 5 5 Tested up to: 4.6.1 6 Stable tag: 1.1. 36 Stable tag: 1.1.4 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 23 23 Parameter 'preload', preload mode, 'auto', 'metatdata' or 'none'. Optional and default metadata. 24 24 Parameter 'hotkey', enable builtin hotkey? including left, right and Space. Optional and default true. 25 Parameter 'bilibili', bilibili视频AV号 . Additional danmaku from bilibili25 Parameter 'bilibili', bilibili视频AV号 或者 完整的bilibili视频链接. Additional danmaku from bilibili 26 26 Parameter 'danmu', should DPlayer load danmaku. Default false and it's optional. 27 27 … … 39 39 40 40 == Changelog == 41 42 = 1.1.4 = 43 * Extended support for bilibili param, now you can use either 44 - bilibili='23333' 45 - bilibili='http://www.bilibili.com/video/av2333333/index_233.html#page=2333' 46 to load additional danmaku. 47 48 This plugin will give you exactly the danma that you need, which means, 49 50 If you give the original URL to the bilibili video, this plugin will identify the URL format, load the right danmaku. In this example, 'http://www.bilibili.com/video/av2333333/index_23333#page=233' is given. And the plugin knows that aid is 2333333 and your requested page is 2333. (According to bilibili, 'index_233.html#page=2333' means that you starts at page 233 but currently you're watching page 2333) 41 51 42 52 = 1.1.3 =
Note: See TracChangeset
for help on using the changeset viewer.