Plugin Directory

Changeset 1694456


Ignore:
Timestamp:
07/11/2017 01:15:56 PM (9 years ago)
Author:
0xbbc
Message:

support bilibili via prprpr.me

Location:
dplayer-for-wp
Files:
1 deleted
2 edited
4 copied

Legend:

Unmodified
Added
Removed
  • dplayer-for-wp/tags/1.1.9/dplayer.php

    r1694437 r1694456  
    33* Plugin Name: DPlayer for WordPress
    44* Description: Wow, such a lovely HTML5 danmaku video player comes to WordPress
    5 * Version: 1.1.8
     5* Version: 1.1.9
    66* Author: 0xBBC
    77* Author URI: https://blog.0xbbc.com/
     
    9898        // normalize attribute keys, lowercase
    9999        $atts = array_change_key_case((array)$atts, CASE_LOWER);
    100        
    101         $id = md5($_SERVER['HTTP_HOST'] . $atts['url']);
     100        $bilibili_param = $atts['bilibili'] ? $atts['bilibili'] : '';
     101        $id = md5($_SERVER['HTTP_HOST'] . $atts['url'] . $bilibili_param);
    102102        $result = array(
    103103            'url' => $atts['url'] ? $atts['url'] : '',
    104             'pic' => $atts['pic'] ? $atts['pic'] : ''
     104            'pic' => $atts['pic'] ? $atts['pic'] : '',
     105            'type' => $atts['type'] ? $atts['type'] : 'auto',
    105106        );
    106         if (empty($result)) return;
    107107       
    108108        $theme = $atts['theme'];
     
    128128        $playerCode = '<div id="player'.$id.'" class="dplayer">';
    129129        $playerCode .= "</div>\n";
    130         $data['video'] = $result;
    131130
    132131        $danmaku = array(
     
    136135        );
    137136       
    138         if ($atts['bilibili']) $danmaku['addition'] = DPlayer::dplayer_bilibili_url_handler($atts['bilibili']);
     137        if ($bilibili_param) {
     138            $danmaku['addition'] = DPlayer::dplayer_bilibili_url_handler($bilibili_param);
     139            if (empty($atts['url'])) $result['url'] = $bilibili_param;
     140        }
     141       
     142        $data['video'] = $result;
    139143        $data['danmaku'] = ($atts['danmu'] != 'false') ? $danmaku : null;
    140144
  • dplayer-for-wp/tags/1.1.9/readme.txt

    r1694437 r1694456  
    44Requires at least: 3.0.1
    55Tested up to: 4.8.0
    6 Stable tag: 1.1.8
     6Stable tag: 1.1.9
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
  • dplayer-for-wp/trunk/dplayer.php

    r1694437 r1694456  
    33* Plugin Name: DPlayer for WordPress
    44* Description: Wow, such a lovely HTML5 danmaku video player comes to WordPress
    5 * Version: 1.1.8
     5* Version: 1.1.9
    66* Author: 0xBBC
    77* Author URI: https://blog.0xbbc.com/
     
    9898        // normalize attribute keys, lowercase
    9999        $atts = array_change_key_case((array)$atts, CASE_LOWER);
    100        
    101         $id = md5($_SERVER['HTTP_HOST'] . $atts['url']);
     100        $bilibili_param = $atts['bilibili'] ? $atts['bilibili'] : '';
     101        $id = md5($_SERVER['HTTP_HOST'] . $atts['url'] . $bilibili_param);
    102102        $result = array(
    103103            'url' => $atts['url'] ? $atts['url'] : '',
    104             'pic' => $atts['pic'] ? $atts['pic'] : ''
     104            'pic' => $atts['pic'] ? $atts['pic'] : '',
     105            'type' => $atts['type'] ? $atts['type'] : 'auto',
    105106        );
    106         if (empty($result)) return;
    107107       
    108108        $theme = $atts['theme'];
     
    128128        $playerCode = '<div id="player'.$id.'" class="dplayer">';
    129129        $playerCode .= "</div>\n";
    130         $data['video'] = $result;
    131130
    132131        $danmaku = array(
     
    136135        );
    137136       
    138         if ($atts['bilibili']) $danmaku['addition'] = DPlayer::dplayer_bilibili_url_handler($atts['bilibili']);
     137        if ($bilibili_param) {
     138            $danmaku['addition'] = DPlayer::dplayer_bilibili_url_handler($bilibili_param);
     139            if (empty($atts['url'])) $result['url'] = $bilibili_param;
     140        }
     141       
     142        $data['video'] = $result;
    139143        $data['danmaku'] = ($atts['danmu'] != 'false') ? $danmaku : null;
    140144
  • dplayer-for-wp/trunk/readme.txt

    r1694437 r1694456  
    44Requires at least: 3.0.1
    55Tested up to: 4.8.0
    6 Stable tag: 1.1.8
     6Stable tag: 1.1.9
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
Note: See TracChangeset for help on using the changeset viewer.