Skip to content

Commit 54cf114

Browse files
committed
Merge pull request #635 from C4Framework/MutedMovie
Muted movie
2 parents 2c08094 + 9ffd7c4 commit 54cf114

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

Diff for: C4/UI/Movie.swift

+15
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,21 @@ public class Movie: View {
8888
}
8989
}
9090

91+
/// Mute/Unmute the audio track.
92+
///
93+
/// The default value of this property is `false`.
94+
public var muted: Bool {
95+
get {
96+
guard let p = player else {
97+
return false
98+
}
99+
return p.muted
100+
}
101+
set {
102+
player?.muted = newValue
103+
}
104+
}
105+
91106
var movieLayer: PlayerLayer {
92107
get {
93108
return self.movieView.movieLayer

Diff for: C4/UI/View.swift

+2-4
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ public class View: NSObject {
101101

102102
if let maskToCopy = viewToCopy.mask {
103103
if viewToCopy.mask is Shape {
104-
mask = Shape(copy: viewToCopy.mask as! Shape)
104+
mask = Shape(copy: viewToCopy.mask as! Shape) // swiftlint:disable:this force_cast
105105
} else if viewToCopy.mask is Image {
106-
mask = Image(copy: viewToCopy.mask as! Image)
106+
mask = Image(copy: viewToCopy.mask as! Image) // swiftlint:disable:this force_cast
107107
} else {
108108
mask = View(copyView: maskToCopy)
109109
}
@@ -568,5 +568,3 @@ public class View: NSObject {
568568
zPosition = view.zPosition - 1
569569
}
570570
}
571-
572-

0 commit comments

Comments
 (0)