0

I'am trying to add airplay for my audio app. Here is my code

let buttonView  = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
let routerPickerView =  AVRoutePickerView(frame: buttonView.bounds)
routerPickerView.tintColor = UIColor.white
routerPickerView.activeTintColor = UIColor.white
buttonView.addSubview(routerPickerView)
self.btnsStack.addArrangedSubview(buttonView)

This works well with my Mac, but when I try to play it with my Samsung Smart TV, there is a loader keeps on spinning. I tried connecting my TV with other apps like Spotify and it works.

  • Does your smartTV is compatible with AirPlay ? – Ptit Xav Mar 06 '22 at 21:08
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Mar 07 '22 at 04:48

1 Answers1

1

Found my solution, so for casting airplay with smart tv one line of code is must

    player?.allowsExternalPlayback = false

player is your AVPlayer.