Timedmetadata' Deprecated. Another Method? <Updated>

timedMetadata' Deprecated. Another method? UPDATED


    func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) {
if let item = groups.first?.items.first // make this an AVMetadata item
{
item.value(forKeyPath: "value") // looking for that key bro
let Song = (item.value(forKeyPath: "value")!)
MetaData = "Now Playing: \n \(Song)" // print the results
} else {
MetaData = "MetaData Error" // No Metadata or Could not read
}

What method should I use instead of a deprecated 'resumeAnimation(forKey:)'?

You can retrieve an SCNAnimationPlayer using animationPlayer(forKey:) and then set its paused property to true.

MPSCNNConvolutionDescriptor neuronFilter deprecated

"You must implement now the convolution family" Anyhow neuronType, neuronParameterA and neuronParameterB...

The process has changed but not that much, I think you would do it without too much trouble.

And yes, neuronFilter is fully deprecated.

Sample Image

This is the new way to go:

Declaration

class MPSCNNConvolutionDescriptor : NSObject

Overview

You use an MPSCNNConvolutionDescriptor object to describe the properties of an MPSCNNConvolution kernel such as its size, pixel format and CPU cache mode.

Don't use a MPSCNNNeuron (neuronFilter) use a MPSCNNKernel instead.

You have a nice day!

Timed Metadata with AVPlayer

Apparently, AVPlayer automatically requests metadata from Icecast. The code below works perfectly.

class ViewController: UIViewController {
var Player: AVPlayer!
var PlayerItem: AVPlayerItem!

override func viewDidLoad() {
super.viewDidLoad()

PlayerItem = AVPlayerItem(URL: NSURL(string: "http://live.machine.fm/aac"))
PlayerItem.addObserver(self, forKeyPath: "timedMetadata", options: nil, context: nil)
Player = AVPlayer(playerItem: PlayerItem)
Player.play()
}

override func observeValueForKeyPath(keyPath: String, ofObject object: AnyObject, change: [NSObject : AnyObject], context: UnsafeMutablePointer<Void>) -> Void {

if keyPath != "timedMetadata" { return }

var data: AVPlayerItem = object as AVPlayerItem

for item in data.timedMetadata as [AVMetadataItem] {
println(item.value)
}
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}

Swift Read in UTF8 String from MPMoviePlayerController metadata

This is a problem in the library, you cannot fix it because the string is already decoded from data.

There is a reason why the whole set of classes was deprecated in iOS 9.

You should use AVPlayerViewController & AVPlayer & AVPlayerItem & AVMetadataItem.

They are solving this issue. Don't use MPMoviePlayerController.



Related Topics



Leave a reply



Submit