Skip to content

Commit

Permalink
Merge pull request #634 from C4Framework/humtapUpdates
Browse files Browse the repository at this point in the history
humtap-muteMovie updates
  • Loading branch information
traviskirton committed Mar 2, 2016
2 parents 6b090e9 + 26a025e commit e420e99
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion C4/UI/C4Movie.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ public class C4Movie: C4View {
/// The default value of this property is `true`.
public var loops: Bool = true

/// 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
}
}

/// A variable that provides access to the width of the receiver. Animatable.
/// The default value of this property is defined by the movie being created.
/// Assigning a value to this property causes the receiver to change the width of its frame. If the receiver's
Expand Down Expand Up @@ -153,6 +168,9 @@ public class C4Movie: C4View {
movieLayer.videoGravity = AVLayerVideoGravityResize

originalSize = self.size

// unmute
muted = false
}

/// Initializes a new C4Movie using the specified frame.
Expand Down Expand Up @@ -197,7 +215,7 @@ public class C4Movie: C4View {
p.seekToTime(CMTimeMake(0, 1))
p.pause()
}

/// The action to perform at the end of playback.
///
/// - parameter action: A block of code to execute at the end of playback.
Expand Down

0 comments on commit e420e99

Please sign in to comment.