File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ public struct Media: Codable, Identifiable {
4545
4646 /// URL to the media content
4747 public let url : URL ?
48+
49+ /// Each media object may have multiple display or playback variants, with different resolutions or formats
50+ public let variants : [ Variant ] ?
4851}
4952
5053public enum MediaType : String , Codable , RawRepresentable {
@@ -86,6 +89,17 @@ extension Media {
8689 /// The number of views the media has received
8790 public let viewCount : Int
8891 }
92+
93+ public struct Variant : Codable {
94+ /// Bitrate of the media resource
95+ var bitRate : Int ?
96+
97+ /// Type of media
98+ var contentType : MediaType
99+
100+ /// URL to the media content
101+ var url : String
102+ }
89103}
90104
91105extension Media : Fielded {
@@ -104,6 +118,7 @@ extension Media: Fielded {
104118 case \. url: return " url "
105119 case \. organicMetrics: return " organic_metrics "
106120 case \. promotedMetrics: return " promoted_metrics "
121+ case \. variants: return " variants "
107122 default : return nil
108123 }
109124 }
You can’t perform that action at this time.
0 commit comments