diff --git a/core/modules/media/config/schema/media.schema.yml b/core/modules/media/config/schema/media.schema.yml index 3adeb77..27e0768 100644 --- a/core/modules/media/config/schema/media.schema.yml +++ b/core/modules/media/config/schema/media.schema.yml @@ -52,11 +52,11 @@ media.source.image: type: media.source.field_aware label: '"Image" media source configuration' -media.source.local_audio: +media.source.file_audio: type: media.source.field_aware label: '"Audio" media source configuration' -media.source.local_video: +media.source.file_video: type: media.source.field_aware label: '"Video" media source configuration' diff --git a/core/modules/media/src/Plugin/media/Source/LocalAudio.php b/core/modules/media/src/Plugin/media/Source/LocalAudio.php index 710baaa..0fbb650 100644 --- a/core/modules/media/src/Plugin/media/Source/LocalAudio.php +++ b/core/modules/media/src/Plugin/media/Source/LocalAudio.php @@ -11,9 +11,9 @@ * @see \Drupal\file\FileInterface * * @MediaSource( - * id = "local_audio", + * id = "file_audio", * label = @Translation("Audio (local)"), - * description = @Translation("Use local audios for reusable media."), + * description = @Translation("Use audio files for reusable media."), * allowed_field_types = {"file"}, * default_thumbnail_filename = "audio.png" * ) @@ -24,7 +24,7 @@ class LocalAudio extends File { * {@inheritdoc} */ public function createSourceField(MediaTypeInterface $type) { - return parent::createSourceField($type)->set('settings', ['file_extensions' => 'mp3 ogg wav wma aiff aac']); + return parent::createSourceField($type)->set('settings', ['file_extensions' => 'mp3 ogg wav wma aiff aac m4a']); } /** diff --git a/core/modules/media/src/Plugin/media/Source/LocalVideo.php b/core/modules/media/src/Plugin/media/Source/LocalVideo.php index cf40b86..a285d3c 100644 --- a/core/modules/media/src/Plugin/media/Source/LocalVideo.php +++ b/core/modules/media/src/Plugin/media/Source/LocalVideo.php @@ -11,9 +11,9 @@ * @see \Drupal\file\FileInterface * * @MediaSource( - * id = "local_video", + * id = "file_video", * label = @Translation("Video (local)"), - * description = @Translation("Use local videos for reusable media."), + * description = @Translation("Use video files for reusable media."), * allowed_field_types = {"file"}, * default_thumbnail_filename = "video.png" * ) diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceAudioVideoTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceAudioVideoTest.php index 53b3001..3b53952 100644 --- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceAudioVideoTest.php +++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceAudioVideoTest.php @@ -17,7 +17,7 @@ class MediaSourceAudioVideoTest extends MediaSourceTestBase { * Check the Local Audio source functionality. */ public function testAudioTypeCreation() { - $source_id = 'local_audio'; + $source_id = 'file_audio'; $type_name = 'audio_type'; $field_name = 'field_media_' . $source_id; $this->doTestCreateMediaType($type_name, $source_id); @@ -27,7 +27,7 @@ public function testAudioTypeCreation() { $this->assertNotNull($storage); $field = FieldConfig::load("media.$type_name.$field_name"); $this->assertNotNull($field); - $this->assertSame('mp3 ogg wav wma aiff aac', FieldConfig::load("media.$type_name.$field_name")->get('settings')['file_extensions']); + $this->assertSame('mp3 ogg wav wma aiff aac m4a', FieldConfig::load("media.$type_name.$field_name")->get('settings')['file_extensions']); // Check that the display holds the correct formatter configuration. $display = EntityViewDisplay::load("media.$type_name.default"); @@ -40,7 +40,7 @@ public function testAudioTypeCreation() { * Check the Local Video source functionality. */ public function testVideoTypeCreation() { - $source_id = 'local_video'; + $source_id = 'file_video'; $type_name = 'video_type'; $field_name = 'field_media_' . $source_id; $this->doTestCreateMediaType($type_name, $source_id);