Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

v6.0.2 > Master #47

Merged
merged 19 commits into from
Apr 1, 2016
Prev Previous commit
Next Next commit
naming
  • Loading branch information
Gavin King committed Mar 10, 2016
commit bb3277d25ecc8e9fba44d679ba61905612db4f84
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ViewController: UIViewController, VIMVideoPlayerViewDelegate
@IBOutlet weak var slider: UISlider!

private var isScrubbing = false

override func viewDidLoad()
{
super.viewDidLoad()
Expand All @@ -23,14 +23,14 @@ class ViewController: UIViewController, VIMVideoPlayerViewDelegate
self.setupSlider()
}

// MARK: VIMVideoPlayerViewDelegate

// MARK: Setup
private func setupVideoPlayerView()
{
self.videoPlayerView.player.looping = true
self.videoPlayerView.player.disableAirplay()
self.videoPlayerView.setVideoFillMode(AVLayerVideoGravityResizeAspectFill)

self.videoPlayerView.delegate = self

if let path = NSBundle.mainBundle().pathForResource("field", ofType: "mp4")
Expand Down Expand Up @@ -64,7 +64,7 @@ class ViewController: UIViewController, VIMVideoPlayerViewDelegate
else
{
sender.selected = false

self.videoPlayerView.player.play()
}
}
Expand Down Expand Up @@ -113,9 +113,9 @@ class ViewController: UIViewController, VIMVideoPlayerViewDelegate
return
}

let totalTimeInSeconds = Float(CMTimeGetSeconds(duration))
let currentTimeInSeconds = Float(CMTimeGetSeconds(cmTime))
let durationInSeconds = Float(CMTimeGetSeconds(duration))
let timeInSeconds = Float(CMTimeGetSeconds(cmTime))

self.slider.value = currentTimeInSeconds / totalTimeInSeconds
self.slider.value = timeInSeconds / durationInSeconds
}
}