StreamingKit icon indicating copy to clipboard operation
StreamingKit copied to clipboard

How to get the http audio stream metadata

Open Tommecpe opened this issue 11 years ago • 8 comments

I'm currently using AVPlayerItem to stream my audio source. I would like to use audjustable but I need to be able to get my songs title.

Currently I'm using KVO on avplayeritem.timedMetadata.

How can I get the audio stream metadata in audjustable

By the way, thank for the great work !

Tommecpe avatar May 23 '13 09:05 Tommecpe

+1 need this too. So much!

DZamataev avatar Jan 16 '14 14:01 DZamataev

code snippet mentioned by @Tommecpe which is useful to read metadata with AVPlayer may look like this

AVPlayerItem* playerItem = [AVPlayerItem playerItemWithURL:streamUrl];
[playerItem addObserver:self forKeyPath:@"timedMetadata" options:NSKeyValueObservingOptionNew context:nil];
AVPlayer* player = [AVPlayer playerWithPlayerItem:playerItem] ;
[player play];
- (void) observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object
                        change:(NSDictionary*)change context:(void*)context {

   if ([keyPath isEqualToString:@"timedMetadata"])
   {
      AVPlayerItem* playerItem = object;

      for (AVMetadataItem* metadata in playerItem.timedMetadata)
      {
         NSLog(@"\nkey: %@\nkeySpace: %@\ncommonKey: %@\nvalue: %@", [metadata.key description], metadata.keySpace, metadata.commonKey, metadata.stringValue);
      }
   }
}

is there something like this in audjustable AudioPlayer or HttpDataSource? My best option is to be notified via delegate.

DZamataev avatar Jan 16 '14 15:01 DZamataev

What type of metadata are you trying to get? Track name...ID3 tags etc?

tumtumtum avatar Feb 02 '14 15:02 tumtumtum

Yes, track name is most needed.

02 ôåâð. 2014 ã., â 23:54, Thong Nguyen [email protected] íàïèñàë(à):

What type of metadata are you trying to get? Track name...ID3 tags etc?

— Reply to this email directly or view it on GitHub.

DZamataev avatar Feb 02 '14 21:02 DZamataev

@tumtumtum could you please comment on this.

DZamataev avatar Feb 18 '14 13:02 DZamataev

It's not supported at the moment. Pull requests are welcome.

tumtumtum avatar Feb 18 '14 13:02 tumtumtum

+1 need this too. It will be awesome to use it with metadata.

muthuka avatar May 12 '14 19:05 muthuka

Any update on ID3 MetaData?

sandeepo2o avatar Mar 19 '19 04:03 sandeepo2o