mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
Update
This commit is contained in:
parent
bcaa41ca15
commit
15a35cfb8c
4 changed files with 12 additions and 10 deletions
|
@ -922,7 +922,7 @@ class API extends PluginAbstract
|
|||
$rows[$key]['videos'] = Video::getVideosPaths($value['filename'], true);
|
||||
} else {
|
||||
$extension = getExtension($rows[$key]['videoLink']);
|
||||
$rows[$key]['videoLink'] = AVideoPlugin::modifyURL($rows[$key]['videoLink']);
|
||||
$rows[$key]['videoLink'] = AVideoPlugin::modifyURL($rows[$key]['videoLink'], $rows[$key]['id']);
|
||||
if ($extension == 'mp4') {
|
||||
$rows[$key]['videos'] = array(
|
||||
'mp4' => array(
|
||||
|
@ -1025,7 +1025,7 @@ class API extends PluginAbstract
|
|||
$rows[$key]['relatedVideos'][$key2]['videos'] = Video::getVideosPaths($value2['filename'], true);
|
||||
}
|
||||
if(!empty($rows[$key]['relatedVideos'][$key2]['videoLink'])){
|
||||
$rows[$key]['relatedVideos'][$key2]['videoLink'] = AVideoPlugin::modifyURL($rows[$key]['relatedVideos'][$key2]['videoLink']);
|
||||
$rows[$key]['relatedVideos'][$key2]['videoLink'] = AVideoPlugin::modifyURL($rows[$key]['relatedVideos'][$key2]['videoLink'], $value2['id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2828,18 +2828,20 @@ class AVideoPlugin
|
|||
]
|
||||
* @return $file
|
||||
*/
|
||||
public static function modifyURL($file)
|
||||
public static function modifyURL($file, $videos_id=0)
|
||||
{
|
||||
global $global;
|
||||
if (empty($global)) {
|
||||
$global = [];
|
||||
}
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
$videos_id = 0;
|
||||
if(!empty($file['filename'])){
|
||||
$videos_id = getVideos_IdFromFilename($file['filename']);
|
||||
}else{
|
||||
$videos_id = getVideos_id();
|
||||
if(empty($videos_id)){
|
||||
$videos_id = 0;
|
||||
if(!empty($file['filename'])){
|
||||
$videos_id = getVideos_IdFromFilename($file['filename']);
|
||||
}else{
|
||||
$videos_id = getVideos_id();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @var array $global
|
||||
|
|
|
@ -132,7 +132,7 @@ class PlayerSkins extends PluginAbstract
|
|||
if ($video['type'] == "video") {
|
||||
$htmlMediaTag .= "<!-- Video {$video['title']} {$video['filename']} -->" . getSources($video['filename']);
|
||||
} else { // video link
|
||||
$url = AVideoPlugin::modifyURL($video['videoLink']);
|
||||
$url = AVideoPlugin::modifyURL($video['videoLink'], $video['id']);
|
||||
//var_dump($video['videoLink'], $url);exit;
|
||||
$htmlMediaTag .= "<!-- Video Link {$video['title']} {$video['filename']} --><source src='{$url}' type='" . ((strpos($video['videoLink'], 'm3u8') !== false) ? "application/x-mpegURL" : "video/mp4") . "' >";
|
||||
$html .= "<script>$(document).ready(function () {\$('time.duration').hide();});</script>";
|
||||
|
|
|
@ -861,7 +861,7 @@ abstract class PluginAbstract {
|
|||
]
|
||||
* @return $file
|
||||
*/
|
||||
function modifyURL($file) {
|
||||
function modifyURL($file, $videos_id=0) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue