-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* On Mediaupload attach video to currently selected playlist * Implement dropdown to choose playlist in mediaupload dialog * Make sure a course mediaupload isnt added to default playlist * Make sure only Videos with tokens are available thru the backend * After mediaupload, visualize that the video is processing and bugfix
- Loading branch information
Showing
8 changed files
with
157 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
namespace Opencast\Routes\Video; | ||
|
||
use Psr\Http\Message\ResponseInterface as Response; | ||
use Psr\Http\Message\ServerRequestInterface as Request; | ||
use Opencast\Errors\AuthorizationFailedException; | ||
use Opencast\Errors\Error; | ||
use Opencast\OpencastTrait; | ||
use Opencast\OpencastController; | ||
use Opencast\Models\Videos; | ||
|
||
class VideoAdd extends OpencastController | ||
{ | ||
use OpencastTrait; | ||
|
||
public function __invoke(Request $request, Response $response, $args) | ||
{ | ||
$json = $this->getRequestData($request); | ||
$event = $json['event']; | ||
|
||
$episode_id = $args['episode_id']; | ||
|
||
$ret = []; | ||
|
||
$video = Videos::findByEpisode($episode_id); | ||
if (!empty($video) || !isset($event['config_id'])) { | ||
$message = [ | ||
'type' => 'error', | ||
'text' => _('Beim Erstellen des Videos ist ein Fehler aufgetreten.') | ||
]; | ||
} | ||
else { | ||
$video = new Videos; | ||
$video->setData([ | ||
'episode' => $episode_id, | ||
'config_id' => $event['config_id'], | ||
'title' => $event['title'], | ||
'description' => $event['description'], | ||
'duration' => $event['duration'], | ||
'state' => $event['state'], | ||
'available' => false | ||
]); | ||
if (!$video->token) { | ||
$video->token = bin2hex(random_bytes(8)); | ||
} | ||
$video->store(); | ||
|
||
$ret = $video->toSanitizedArray(); | ||
|
||
$message = [ | ||
'type' => 'success', | ||
'text' => _('Das Video wurde erfolgreich erstellt.') | ||
]; | ||
} | ||
|
||
return $this->createResponse([ | ||
'message' => $message, | ||
'event' => $ret | ||
], $response->withStatus(200)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters