Trying to play audio with Swift AVPlayer

前端 未结 1 607
甜味超标
甜味超标 2021-01-13 09:24

Here\'s my current ViewController:

import UIKit
import AVFoundation

class SecondViewController: UIViewController {
    override func viewDidLoad() {
                


        
相关标签:
1条回答
  • 2021-01-13 10:15

    Move the line:

        var player = AVPlayer()
    

    ... so that it is before the line:

    override func viewDidLoad() {
    
    0 讨论(0)
提交回复
热议问题