//
//  AVPlayerItem.swift
//  MusicPlayer
//
//  Created by Mr.Zhou on 2024/5/23.
//

import AVFoundation
import ObjectiveC

private var playerItemContext: UInt8 = 0

extension AVPlayerItem {
    var uniqueID: String? {
        get {
            return objc_getAssociatedObject(self, &playerItemContext) as? String
        }
        set {
            objc_setAssociatedObject(self, &playerItemContext, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
        }
    }
}
