diff --git a/plugin/PlayLists/PlayListElement.php b/plugin/PlayLists/PlayListElement.php index b943378ba..c62d72edb 100644 --- a/plugin/PlayLists/PlayListElement.php +++ b/plugin/PlayLists/PlayListElement.php @@ -1,108 +1,169 @@ name = $name; $this->description = $description; $this->setDuration($duration); $this->sources = $playListSource; $this->thumbnail = $playListThumbnail; $this->poster = $poster; $this->videoStartSeconds = $videoStartSeconds; $this->created = strtotime($created); $this->likes = $likes; $this->views = $views; $this->videos_id = $videos_id; $this->className = $className; $this->tracks = $tracks; } function getName() { return $this->name; } function getDescription() { return $this->description; } function getDuration() { return $this->duration; } function getPlayListSource() { return $this->sources; } function getPlayListThumbnail() { return $this->playListThumbnail; } function setName($name) { $this->name = $name; } function setDescription($description) { $this->description = $description; } function setDuration($duration) { if (!is_int($duration)) { $duration = parseDurationToSeconds($duration); } $this->duration = $duration; } function setPlayListSource($playListSource) { $this->sources = $playListSource; } function setPlayListThumbnail($playListThumbnail) { $this->thumbnail = $playListThumbnail; } - - - + function getSources() { + return $this->sources; + } + + function getThumbnail() { + return $this->thumbnail; + } + + function getPoster() { + return $this->poster; + } + + function getVideoStartSeconds() { + return $this->videoStartSeconds; + } + + function getCreated() { + return $this->created; + } + + function getLikes() { + return $this->likes; + } + + function getViews() { + return $this->views; + } + + function getVideos_id() { + return $this->videos_id; + } + + function setSources($sources) { + $this->sources = $sources; + } + + function setThumbnail($thumbnail) { + $this->thumbnail = $thumbnail; + } + + function setPoster($poster) { + $this->poster = $poster; + } + + function setVideoStartSeconds($videoStartSeconds) { + $this->videoStartSeconds = $videoStartSeconds; + } + + function setCreated($created) { + $this->created = $created; + } + + function setLikes($likes) { + $this->likes = $likes; + } + + function setViews($views) { + $this->views = $views; + } + + function setVideos_id($videos_id) { + $this->videos_id = $videos_id; + } + } class playListSource { public $src, $type; function __construct($src, $youtube = false) { $this->src = $src; $this->label = getResolutionFromFilename($src); if(empty($this->label)){ $this->label = 'Auto'; }else{ $this->label .= 'p'; } if($youtube){ $this->type = "video/youtube"; }else{ $this->type = mime_content_type_per_filename($src); } if($this->type=="application/x-mpegURL"){ $obj = AVideoPlugin::getDataObject('VideoHLS'); if(!empty($obj->downloadProtection)){ if(!preg_match('/token=/', $this->src)){ $this->src = addQueryStringParameter($this->src, token, VideoHLS::getToken()); } } } } } class playListThumbnail { public $srcset, $type, $media = '(min-width: 400px;)'; } diff --git a/plugin/PlayLists/player.php b/plugin/PlayLists/player.php index 87b546c6f..2bf513d4d 100644 --- a/plugin/PlayLists/player.php +++ b/plugin/PlayLists/player.php @@ -1,345 +1,345 @@ $value) { if(!User::isAdmin() && !Video::userGroupAndVideoGroupMatch($users_id, $value['videos_id'])){ unset($playList[$key]); continue; } if ($value['type'] === 'embed') { $sources[0]['type'] = 'video'; $sources[0]['url'] = $value["videoLink"]; } else { $sources = getVideosURL($value['filename']); } $images = Video::getImageFromFilename($value['filename'], $value['type']); $externalOptions = _json_decode($value['externalOptions']); $src = new stdClass(); $src->src = $images->thumbsJpg; $thumbnail = array($src); $playListSources = array(); foreach ($sources as $value2) { if ($value2['type'] !== 'video' && $value2['type'] !== 'audio' && $value2['type'] !== 'serie') { continue; } $playListSources[] = new playListSource($value2['url'], $value['type'] === 'embed'); } if (empty($playListSources)) { continue; } $playListData[] = new PlayListElement($value['title'], $value['description'], $value['duration'], $playListSources, $thumbnail, $images->poster, parseDurationToSeconds(@$externalOptions->videoStartSeconds), $value['cre'], $value['likes'], $value['views_count'], $value['videos_id']); } $video = PlayLists::isPlayListASerie($_GET['playlists_id']); $playlist_index = intval(@$_REQUEST['playlist_index']); if (!empty($video['id'])) { AVideoPlugin::getEmbed($video['id']); setVideos_id($video['id']); } else if (!empty($playListData[$playlist_index])) { - setVideos_id($playListData[$playlist_index]['id']); + setVideos_id($playListData[$playlist_index]->getVideos_id()); } ?>