输入' ViewController'不符合协议' MPMediaPlayback'

时间:2015-06-30 09:56:07

标签: ios swift uiviewcontroller

尝试开发视频播放器时收到此错误消息。

  

/Users/MNurdin/Documents/iOS/SwiftVideoPlayer/SwiftVideoPlayer/ViewController.swift:12:1:   输入' ViewController'不符合协议' MPMediaPlayback'

我的代码

import UIKit
import MediaPlayer

class ViewController: UIViewController, MPMediaPlayback { //error message here

    var isPreparedToPlay: Bool = true
    var currentPlaybackRate: Float = 0.0
    var currentPlaybackTime: NSTimeInterval = 0.0

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    func play() {

    }

    func pause() {

    }

    func stop() {

    }

    func prepareToPlay() {

    }

    func beginSeekingBackward() {

    }

    func beginSeekingForward() {

    }

    func endSeeking() {

    }

}

我在这里缺少什么?

源代码:https://github.com/datomnurdin/SwiftVideoPlayer

参考:https://developer.apple.com/library/ios/documentation/MediaPlayer/Reference/MPMediaPlayback_protocol/index.html#//apple_ref/occ/intfp/MPMediaPlayback/currentPlaybackTime

0 个答案:

没有答案