@@ -19,19 +19,31 @@ final class PlaybackURLTests: XCTestCase {
19
19
}
20
20
21
21
func testMaximumResolution( ) throws {
22
- let playbackOptions = PlaybackOptions (
23
- maximumResolutionTier: . upTo720p
24
- )
25
-
26
- let playerItem = AVPlayerItem (
27
- playbackID: " abc " ,
28
- playbackOptions: playbackOptions
29
- )
30
22
31
- XCTAssertEqual (
32
- ( playerItem. asset as! AVURLAsset ) . url. absoluteString,
33
- " https://stream.mux.com/abc.m3u8?redundant_streams=true&max_resolution=720p "
34
- )
23
+ let expectedURLs : [ String : String ] = [
24
+ ResolutionTier . upTo720p. queryValue: " https://stream.mux.com/abc.m3u8?redundant_streams=true&max_resolution=720p " ,
25
+ ResolutionTier . upTo1080p. queryValue: " https://stream.mux.com/abc.m3u8?redundant_streams=true&max_resolution=1080p " ,
26
+ ResolutionTier . upTo2160p. queryValue: " https://stream.mux.com/abc.m3u8?redundant_streams=true&max_resolution=2160p " ,
27
+ ResolutionTier . default. queryValue: " https://stream.mux.com/abc.m3u8?redundant_streams=true " ,
28
+ ]
29
+
30
+ let tiers : [ ResolutionTier ] = [ . upTo720p, . upTo1080p, . upTo2160p, . default]
31
+
32
+ for tier in tiers {
33
+ let playbackOptions = PlaybackOptions (
34
+ maximumResolutionTier: tier
35
+ )
36
+
37
+ let playerItem = AVPlayerItem (
38
+ playbackID: " abc " ,
39
+ playbackOptions: playbackOptions
40
+ )
41
+
42
+ XCTAssertEqual (
43
+ ( playerItem. asset as! AVURLAsset ) . url. absoluteString,
44
+ expectedURLs [ tier. queryValue]
45
+ )
46
+ }
35
47
}
36
48
37
49
func testCustomDomainPlaybackURL( ) throws {
0 commit comments