xiaoyu9965
V2EX  ›  Swift

为什么 AFSoundManager 无法播放 mp3

  •  
  •   xiaoyu9965 · Sep 28, 2015 · 4505 views
    This topic created in 3896 days ago, the information mentioned may be changed or developed.

    直接上代码!
    @IBAction func startPlay(sender: AnyObject) {

    playDisc.startRoatating()
        self.setAnchorPoint(CGPointMake(0.25, 0.13),forView: self.playNeedleImageView)
        self.playNeedlePlay()
    
        let urlMp3 = NSURL(string: "http://api.sport-x.cn/audio/qiannvyouhun.mp3")
        let avPlayer =  AVPlayer.init(URL: urlMp3!)
        avPlayer.play()
    
    
        //let urlMp3 = NSURL(string: "http://api.sport-x.cn/audio/qiannvyouhun.mp3")
        //let myAFSoundItem =  AFSoundItem.init(streamingURL: urlMp3!)
        //let player:AFSoundPlayback = AFSoundPlayback.init(item: myAFSoundItem!)
        //player.play()
    
        print("Player paly!")
    
    }
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2754 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 06:03 · PVG 14:03 · LAX 23:03 · JFK 02:03
    ♥ Do have faith in what you're doing.