public function Output($id) { $data = $this->implementation->Read($id); //Convert params array to object $kp_params = []; foreach ($data->params as $param) { $kp_params[$param->name] = $param->value; } $data->params = $kp_params; $player_name = mediaPlayer::getPlayer($data->type); $player = new $player_name(); $data = $player->build($data); return $data; }
function GenerateMethod() { $tp = $this->task_parts; if ($tp[1]) { echo "<!doctype html>", PHP_EOL; echo "<html>" . PHP_EOL . "<body style=\"margin:0px; height:100vh; width:100%; overflow:hidden;\">", PHP_EOL; $id = $tp[1]; $data = $this->Output($id); //If a type is set ie. this is a video object if ($data->content->type) { $player_name = mediaPlayer::getPlayer($data->content->type); $player = new $player_name(); $data->content = $player->build($data->content); } echo $data->content->source; echo "<style>.video-js{ width:100%; height:100%; </style>", PHP_EOL; echo "<script>var channel_id = '{$data->_id}'; var content_id = '{$data->content_id}';</script>"; echo "<script src=\"bower_components/jquery/dist/jquery.min.js\"></script>"; echo "<script src=\"res/channel/js/auto_refresh.js\"></script>"; echo PHP_EOL . "</body>" . PHP_EOL . "</html>"; } }