Add Video sub-class to MediaTypeNames with common video MIME types#127268
Open
ManickaP wants to merge 2 commits intodotnet:mainfrom
Open
Add Video sub-class to MediaTypeNames with common video MIME types#127268ManickaP wants to merge 2 commits intodotnet:mainfrom
ManickaP wants to merge 2 commits intodotnet:mainfrom
Conversation
Add MediaTypeNames.Video with five commonly-used video container format constants: Mp4, Mpeg, Ogg, QuickTime, and WebM. These are the most widely used video MIME types in web applications and are already mapped in MediaTypeMap. Codec-specific types (H264, VP8, etc.) are excluded as they are rarely used as HTTP Content-Type headers. Fixes dotnet#124392 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new MediaTypeNames.Video nested class to the System.Net.Mime API surface (in System.Net.Mail) to provide constants for commonly used video container MIME types.
Changes:
- Introduce
MediaTypeNames.Videowith constants forvideo/mp4,video/mpeg,video/ogg,video/quicktime, andvideo/webm. - Update the reference contract to include the new
Videonested type. - Add a unit test validating the constant string values.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/libraries/System.Net.Mail/src/System/Net/Mime/MediaTypeNames.cs | Adds the new MediaTypeNames.Video nested class and constants. |
| src/libraries/System.Net.Mail/ref/System.Net.Mail.cs | Updates the public ref contract to include MediaTypeNames.Video. |
| src/libraries/System.Net.Mail/tests/Unit/MediaTypeNamesVideoTest.cs | Adds coverage verifying the new constants match expected MIME strings. |
| src/libraries/System.Net.Mail/tests/Unit/System.Net.Mail.Unit.Tests.csproj | Includes the new test file in the unit test project. |
rzikm
approved these changes
Apr 22, 2026
This was referenced Apr 22, 2026
Open
The test only verified that const string fields matched hardcoded string values, which does not provide meaningful coverage. No other MediaTypeNames sub-classes have such tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Apr 22, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR was created with the assistance of GitHub Copilot.
Add
MediaTypeNames.Videowith five commonly-used video container format constants:Mp4,Mpeg,Ogg,QuickTime, andWebM. These are the most widely used video MIME types in web applications and are already mapped inMediaTypeMap. Codec-specific types (H264, VP8, etc.) are excluded as they are rarely used as HTTP Content-Type headers.Fixes #124392