import UIKit import AVFoundation class VIEwController: UIVIEwController { var player = AVAudioPlayer() overrIDe func vIEwDIDLoad() { super.vIEwDIDLoad() var fileURL: NSURL = NSURL(string: "http://url----.com/playList.m3u8") var error:NSError? player = AVAudioPlayer(contentsOfURL: fileURL,error: &error) if player.preparetoPlay() && player.play(){ println("yes") } else { println("no") } }解决方法@H_502_6@ 这对我有用:
var player = AVPlayer()func configureVIEw() { let url = "http://stream.your.url.com" let playerItem = AVPlayerItem( URL:NSURL( string:url ) ) player = AVPlayer(playerItem:playerItem) player.rate = 1.0; player.play()}总结
以上是内存溢出为你收集整理的IOS 8 Swift AVAudioPlayer播放远程音频(wowza服务器)全部内容,希望文章能够帮你解决IOS 8 Swift AVAudioPlayer播放远程音频(wowza服务器)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)