Skip to content

Add Video sub-class to MediaTypeNames with common video MIME types#127268

Open
ManickaP wants to merge 2 commits intodotnet:mainfrom
ManickaP:api-proposal/video-mediatypenames
Open

Add Video sub-class to MediaTypeNames with common video MIME types#127268
ManickaP wants to merge 2 commits intodotnet:mainfrom
ManickaP:api-proposal/video-mediatypenames

Conversation

@ManickaP
Copy link
Copy Markdown
Member

Note

This PR was created with the assistance of GitHub Copilot.

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 #124392

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>
Copilot AI review requested due to automatic review settings April 22, 2026 09:10
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Video with constants for video/mp4, video/mpeg, video/ogg, video/quicktime, and video/webm.
  • Update the reference contract to include the new Video nested 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.

Comment thread src/libraries/System.Net.Mail/ref/System.Net.Mail.cs
Comment thread src/libraries/System.Net.Mail/tests/Unit/MediaTypeNamesVideoTest.cs Outdated
Comment thread src/libraries/System.Net.Mail/src/System/Net/Mime/MediaTypeNames.cs
Copy link
Copy Markdown
Member

@rzikm rzikm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo nit

Comment thread src/libraries/System.Net.Mail/tests/Unit/MediaTypeNamesVideoTest.cs Outdated
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Add Common Video Types to System.Net.Mime.MediaTypeNames

3 participants