Skip to content

Muted movie #635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions C4/UI/Movie.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,21 @@ public class Movie: View {
}
}

/// Mute/Unmute the audio track.
///
/// The default value of this property is `false`.
public var muted: Bool {
get {
guard let p = player else {
return false
}
return p.muted
}
set {
player?.muted = newValue
}
}

var movieLayer: PlayerLayer {
get {
return self.movieView.movieLayer
Expand Down
6 changes: 2 additions & 4 deletions C4/UI/View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ public class View: NSObject {

if let maskToCopy = viewToCopy.mask {
if viewToCopy.mask is Shape {
mask = Shape(copy: viewToCopy.mask as! Shape)
mask = Shape(copy: viewToCopy.mask as! Shape) // swiftlint:disable:this force_cast
} else if viewToCopy.mask is Image {
mask = Image(copy: viewToCopy.mask as! Image)
mask = Image(copy: viewToCopy.mask as! Image) // swiftlint:disable:this force_cast
} else {
mask = View(copyView: maskToCopy)
}
Expand Down Expand Up @@ -568,5 +568,3 @@ public class View: NSObject {
zPosition = view.zPosition - 1
}
}