Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
if(window.toolbar != undefined){
toolbar[toolbar.length] = {"type": "pluginvshare",
"title": LANG['plugins']['vshare']['button'],
"icon": DOKU_BASE+"lib/plugins/vshare/button.png",
"icon": "../../plugins/vshare/button.png",
"key": ""};
}

Expand Down
1 change: 1 addition & 0 deletions sites.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ metacafe flash http://www.metacafe.com/fplayer/@VIDEO@/foo.swf
myspacetv flash http://lads.myspace.com/videos/vplayer.swf?m=@VIDEO@&v=2&type=video
rcmovie flash http://www.rcmovie.de/embed/@VIDEO@
scivee flash //www.scivee.tv/flash/embedPlayer.swf?id=@VIDEO@&type=3
twitchtv flash http://www.twitch.tv/widgets/live_embed_player.swf?channel=@VIDEO@&auto_play=false&start_volume=25
veoh flash //www.veoh.com/videodetails2.swf?player=videodetailsembedded&type=v&permalinkId=@VIDEO@&id=anonymous


Expand Down
1 change: 1 addition & 0 deletions sites.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var sites = {
'myspacetv': 'vids\\.myspace\\.com\\/.*videoid=(\\d+)',
'rcmovie': 'rcmovie\\.de\\/video\\/([a-f0-9]+)\\/',
'scivee': 'scivee\\.tv\\/node\\/(\\d+)',
'twitchtv': 'twitch\\.tv\\/([a-z0-9_\\-]+)',
'veoh': 'veoh\\.com\\/.*watch[^v]*(v[a-z0-9]+)'
};

32 changes: 32 additions & 0 deletions syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,44 @@ function handle($match, $state, $pos, &$handler){
$height = 350;
}

$paramm = array();
parse_str($param, $paramm);
$urlparam = array();
foreach($paramm as $key => $value) {
switch($key) {
case 'rel':
case 'autoplay':
if($paramm[$key] === '1' || $paramm[$key] === '0') {
$urlparam[] = $key . '=' . $paramm[$key];
}
break;
case 'start':
case 'end':
case 'chapter_id': //for twitch.tv
case 'initial_time':
$number = (int) $paramm[$key];
if($number > 0) {
$urlparam[] = $key . '=' . $number;
}
break;
}
}

list($type, $url) = explode(' ', $this->sites[$site], 2);
$url = trim($url);
$type = trim($type);
$url = str_replace('@VIDEO@',rawurlencode($vid),$url);
$url = str_replace('@WIDTH@',$width,$url);
$url = str_replace('@HEIGHT@',$height,$url);
if(count($urlparam)) {
if(strpos($url, '?') !== false) {
$sepchar = '&';
} else {
$sepchar = '?';
}
$url .= $sepchar . implode('&', $urlparam);
}

list(,$vars) = explode('?',$url,2);
$varr = array();
parse_str($vars,$varr);
Expand Down