Merge branch 'develop' into feature/stream
Conflicts: controllers/FrontController.php
This commit is contained in:
commit
8f14843bb4
1 changed files with 9 additions and 10 deletions
|
@ -112,18 +112,17 @@ class FrontController
|
||||||
if (isset($params["url"])) {
|
if (isset($params["url"])) {
|
||||||
if (isset($params['audio'])) {
|
if (isset($params['audio'])) {
|
||||||
try {
|
try {
|
||||||
$video = $this->download->getJSON($params["url"]);
|
|
||||||
|
|
||||||
//Vimeo needs a correct user-agent
|
|
||||||
ini_set(
|
|
||||||
'user_agent',
|
|
||||||
$video->http_headers->{'User-Agent'}
|
|
||||||
);
|
|
||||||
$url_info = parse_url($video->url);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return $this->getStream($params["url"], 'bestaudio', $response, $request);
|
return $this->getStream($params["url"], 'bestaudio', $response, $request);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
$video = $this->download->getJSON($params["url"]);
|
||||||
|
|
||||||
|
//Vimeo needs a correct user-agent
|
||||||
|
ini_set(
|
||||||
|
'user_agent',
|
||||||
|
$video->http_headers->{'User-Agent'}
|
||||||
|
);
|
||||||
|
$url_info = parse_url($video->url);
|
||||||
if ($url_info['scheme'] == 'rtmp') {
|
if ($url_info['scheme'] == 'rtmp') {
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
header(
|
header(
|
||||||
|
@ -246,7 +245,7 @@ class FrontController
|
||||||
try {
|
try {
|
||||||
return $this->getStream($params["url"], $params["format"], $response, $request);
|
return $this->getStream($params["url"], $params["format"], $response, $request);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$response->getBody()->write($e->getMessage().PHP_EOL);
|
$response->getBody()->write($e->getMessage());
|
||||||
return $response->withHeader('Content-Type', 'text/plain');
|
return $response->withHeader('Content-Type', 'text/plain');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue