Add fallback to bestvideo and worstvideo (fixes #288)

This commit is contained in:
Pierre Rudloff 2020-06-20 13:33:16 +02:00
parent 4ef7a93dce
commit 29756cf290
3 changed files with 23 additions and 17 deletions

View file

@ -31,7 +31,7 @@ abstract class BaseController
*
* @var string
*/
protected $defaultFormat = 'best[protocol=https]/best[protocol=http]';
protected $defaultFormat = 'best/bestvideo';
/**
* Slim dependency container.
@ -74,8 +74,9 @@ abstract class BaseController
$this->sessionSegment = $session->getSegment(self::class);
$this->localeManager = $this->container->get('locale');
if ($this->config->stream) {
$this->defaultFormat = 'best';
if (!$this->config->stream) {
// Force HTTP if stream is not enabled.
$this->defaultFormat = Config::addHttpToFormat($this->defaultFormat);
}
}