Latest 1.0
Homepage https://github.com/foxling/AVPlayerSeeker
License MIT
Platforms ios 8.0, requires ARC
Frameworks AVFoundation
Authors

拖动进度条实时流畅预览视频,类似于 iOS 照片应用播放视频时的拖动效果。
解决直接调用 seekToTime 时的卡顿现象。

func sliderValueChanged(sender: UISlider) {
    if let duration = player.currentItem?.duration {
        let seconds = CMTimeGetSeconds(duration)
        let time = CMTime(seconds: Float64(sender.value) * seconds, preferredTimescale: duration.timescale)
        player.fl_seekSmoothlyToTime(time)
    }
}

Reference

https://developer.apple.com/library/ios/qa/qa1820/_index.html

Latest podspec

{
    "name": "AVPlayerSeeker",
    "version": "1.0",
    "platforms": {
        "ios": "8.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "AVPlayer seek smoothly to time",
    "homepage": "https://github.com/foxling/AVPlayerSeeker",
    "authors": {
        "foxling": "[email protected]"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/foxling/AVPlayerSeeker.git",
        "branch": "master",
        "tag": "1.0"
    },
    "source_files": "AVPlayerSeekToTime/Sources/*.swift",
    "frameworks": "AVFoundation",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This