diff --git a/app/controllers/api/videos.php b/app/controllers/api/videos.php index 3e376050dc..7ff7437291 100644 --- a/app/controllers/api/videos.php +++ b/app/controllers/api/videos.php @@ -346,8 +346,8 @@ App::patch('/v1/videos/:videoId/subtitles/:subtitleId') ->param('videoId', null, new UID(), 'Video unique ID.') ->param('bucketId', '', new CustomId(), 'Subtitle bucket unique ID.') ->param('fileId', '', new CustomId(), 'Subtitle file unique ID.') - ->param('name', '', new Text(128), 'Subtitle name.') - ->param('code', '', new Text(128), 'Subtitle code name.') + ->param('name', '', new Text(32), 'Subtitle customized name.') + ->param('code', '', new Text(3), 'Subtitle 3 letter code name.') ->param('default', false, new Boolean(true), 'Default subtitle.') ->inject('response') ->inject('dbForProject') @@ -748,7 +748,7 @@ App::get('/v1/videos/:videoId/outputs/:output') $_subtitles[] = [ 'id' => $adaptationId, 'baseUrl' => $baseUrl . '/subtitles/' . $subtitle->getId(), - 'code' => $subtitle->getAttribute('code'), + 'name' => $subtitle->getAttribute('name'), ]; $adaptationId++; } diff --git a/app/views/videos/dash.phtml b/app/views/videos/dash.phtml index 2e4ec549d3..fa5b6881ff 100644 --- a/app/views/videos/dash.phtml +++ b/app/views/videos/dash.phtml @@ -12,7 +12,7 @@ echo ''; ?> ?> id="" contentType="" startWithSAP="" segmentAlignment="" bitstreamSwitching="" frameRate="" maxWidth="" par="" lang=""> id="" mimeType="" codecs="" bandwidth="" width="" height="" sar="" audioSamplingRate=""> - + escape($adaptation['baseUrl']); endif;?> @@ -28,10 +28,10 @@ echo ''; ?> getParam('subtitles', []) as $subtitle):?> - + - + escape($subtitle['baseUrl']); endif;?> diff --git a/app/views/videos/hls-master.phtml b/app/views/videos/hls-master.phtml index ea215ca3e6..2265aada07 100644 --- a/app/views/videos/hls-master.phtml +++ b/app/views/videos/hls-master.phtml @@ -4,7 +4,7 @@ #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_audio",NAME="",DEFAULT=,LANGUAGE="",URI="" getParam('subtitles', []) as $subtitle): ?> -#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="",DEFAULT=,AUTOSELECT=NO,FORCED=NO,LANGUAGE="",URI="" +#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="escape($subtitle['name']); ?>",DEFAULT=,AUTOSELECT=NO,FORCED=NO,LANGUAGE="escape($subtitle['code']); ?>",URI="" getParam('renditions', []) as $rendition): ?> #EXT-X-STREAM-INF:BANDWIDTH="",RESOLUTION="",NAME="",SUBTITLES="",AUDIO="" diff --git a/src/Appwrite/Utopia/Response/Model/VideoRendition.php b/src/Appwrite/Utopia/Response/Model/VideoRendition.php index 5e896a2c7a..59ef1c8cd9 100644 --- a/src/Appwrite/Utopia/Response/Model/VideoRendition.php +++ b/src/Appwrite/Utopia/Response/Model/VideoRendition.php @@ -46,18 +46,6 @@ class VideoRendition extends Model 'default' => 0, 'example' => 1592981290, ]) - ->addRule('videoBitRate', [ - 'type' => self::TYPE_INTEGER, - 'description' => 'Video bitrate.', - 'default' => 0, - 'example' => 3050, - ]) - ->addRule('audioBitRate', [ - 'type' => self::TYPE_INTEGER, - 'description' => 'Audio bitrate.', - 'default' => 0, - 'example' => 64, - ]) ->addRule('width', [ 'type' => self::TYPE_INTEGER, 'description' => 'Video width.', @@ -70,6 +58,18 @@ class VideoRendition extends Model 'default' => 0, 'example' => 400, ]) + ->addRule('videoBitRate', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Video bitrate.', + 'default' => 0, + 'example' => 3050, + ]) + ->addRule('audioBitRate', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Audio bitrate.', + 'default' => 0, + 'example' => 64, + ]) ->addRule('status', [ 'type' => self::TYPE_STRING, 'description' => 'Rendition transcoding status',