@@ -13,6 +13,7 @@ public struct Richi {
1313
1414 /// An enum that describes how the video is displayed within a layer’s bounds rectangle.
1515 public enum Gravity {
16+
1617 /// The player should preserve the video’s aspect ratio and fill the layer’s bounds.
1718 case aspectFill
1819
@@ -25,9 +26,13 @@ public struct Richi {
2526
2627 /// An enum that describes the playback state of the Video Player
2728 public enum PlaybackState : Equatable , CustomStringConvertible {
29+
2830 /// The playback has failed because of the encapsulated error.
2931 case failed( _ error: Richi . Error )
30-
32+
33+ /// The asset is loading
34+ case loading
35+
3136 /// The playback has been paused
3237 case paused
3338
@@ -41,6 +46,8 @@ public struct Richi {
4146 switch self {
4247 case . failed( let error) :
4348 return " Failed ( \( error) ) "
49+ case . loading:
50+ return " Loading "
4451 case . paused:
4552 return " Paused "
4653 case . playing:
@@ -52,16 +59,18 @@ public struct Richi {
5259
5360 var isPausable : Bool {
5461 switch self {
55- case . paused: fallthrough
62+ case . failed( _) : return false
63+ case . loading: return false
64+ case . paused: return true
5665 case . playing: return true
57- case . failed( _) : fallthrough
5866 case . stopped: return false
5967 }
6068 }
6169
6270 public static func == ( lhs: Richi . PlaybackState , rhs: Richi . PlaybackState ) -> Bool {
6371 switch ( lhs, rhs) {
6472 case ( . failed, . failed) : return true
73+ case ( . loading, . loading) : return true
6574 case ( . paused, . paused) : return true
6675 case ( . playing, . playing) : return true
6776 case ( . stopped, . stopped) : return true
0 commit comments