             let data = JSON(command.arguments[0]);
             let autoPlay = data["autoPlay"].bool ?? false
             
-            self.bufferredTracksJsonArray.append(data)
+            self.bufferredTracksJsonArray!.append(data)
             self.doBuffer(playIndex: 0)
             //self.doAddItem(data);
 

    }

    func doBuffer(playIndex: Int) {
        if playIndex + 2 >= bufferredTracksJsonArray.count {
            // Always load 2 tracks ahead.
            if lastBufferedIndex < bufferredTracksJsonArray!.count - 1 {
                DispatchQueue(label: "cordova-plugin-audio-playlist", qos: .background).async {
                    self.lastBufferedIndex++;
                    self.doAddItem(self.bufferredTracksJsonArray[self.lastBufferedIndex])
                    DispatchQueue.main.async {
                        self.doBuffer(playIndex: playIndex)
                    }

    var callbackId: String? = nil
    var errorCallbackId: String? = nil
    var autoLoopPlaylist: Bool = false
    var bufferredTracksJsonArray: [JSON]!
    var lastBufferedIndex: Int = -1

    @objc(initAudio:)
