0

This is my code. I have checked URL. But there is no sound.

var player = AVPlayer()

func playAudio(sender:UIButton!){
    var btnsendtag:UIButton = sender


    let url : String = self.array_mainlist[btnsendtag.tag]["voice_url"] as String
    let playerItem = AVPlayerItem( URL:NSURL( string:url ) )
    player = AVPlayer(playerItem:playerItem)
    player.rate = 1.0;
    player.play()


}

AND LOG : setMessageLoggingBlock: called

son
  • 1
  • 3

1 Answers1

0

An audio mix can only be used with file-based media and is not supported for use with media served using HTTP Live Streaming.

Otherwise, the audioMix property of an AVPlayerItem can be set to the value of the audioMix property returned by the requestAVAssetForVideo:options:resultHandler: method of PHImageManager.

James Bush
  • 1,485
  • 14
  • 19