player = instancePlayer as WMPLib.IWMPPlayer; //Here
Object instanceFolder = null;
Guid guid_IWMFolder = typeof(WMPLib.IWMPFolderMonitorServices).GUID;
IntPtr ptr1, ptr2;
ptr1 = Marshal.GetComInterfaceForObject(instancePlayer, type);
Marshal.QueryInterface(ptr1, ref guid_IWMFolder, out ptr2);
It seems like the object "player" is not initialized right and stays null.
Which basically means it is not initialized on this line:
CoCreateInstance(guid_IWMPPlayer, null, CLSCTX.CLSCTX_INPROC_SERVER, guid_IUnknown, out instancePlayer);
Check if "instancePlayer" is not null after executing this line.