Skip to content

Commit 91e556d

Browse files
author
emin
committed
change content type to conform to UTType
1 parent 0d4c3a7 commit 91e556d

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

Sources/Types+Media.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Foundation
2+
import UniformTypeIdentifiers
23

34
/// Media refers to any image, GIF, or video attached to a Tweet. The media object is not a primary object on any endpoint, but can be found and expanded in the Tweet object.
45
public struct Media: Codable, Identifiable {
@@ -66,15 +67,6 @@ public enum MediaType: String, Codable, RawRepresentable {
6667
#endif
6768
}
6869

69-
/// Media type specific to `variants` object
70-
public enum ContentMediaType: String, Codable, RawRepresentable {
71-
/// Mpeg media type
72-
case mpeg = "application/x-mpegURL"
73-
74-
/// MP4 video media type. Gif media falls into this case too.
75-
case video = "video/mp4"
76-
}
77-
7870
extension Media {
7971
public struct Metrics: Codable {
8072
/// The number of viewers who watched beyond 0% of the video duration
@@ -104,7 +96,7 @@ extension Media {
10496
public var bitRate: Int?
10597

10698
/// Type of media
107-
public var contentType: ContentMediaType
99+
public var contentType: UTType
108100

109101
/// URL to the media content
110102
public var url: String

0 commit comments

Comments
 (0)