let playerItem = AVPlayerItem(url: url) let player = AVPlayer(playerItem: playerItem) playerLayer.player = player return player }() func play() { player.play() } }
createPlayer() private fun createPlayer(): AVPlayer { val playerItem = AVPlayerItem(uRL = url) val player = AVPlayer(playerItem = playerItem) playerLayer.player = player return player } override fun play() { player.play() } }
encoding in this array. * * Malformed byte sequences are replaced by the replacement char `\uFFFD`. */ @SinceKotlin("1.4") @WasExperimental(ExperimentalStdlibApi::class) public expect fun ByteArray.decodeToString(): String