queue_insert_sync


Description:

public void queue_insert_sync (MediaItem item, MediaItem after_item)

A convenience function that within application main thread synchronously inserts an item to the playback queue position after after_item of the player that this belongs to.

This function uses after_item instead of position index in order to ensure desired position does not change during thread switching.

Reactable enhancers should only modify the queue from the application main thread, switching thread either themselves or using this convenience function that does so.

Note that this function will do no operation if called when there is no player set yet (e.g. inside enhancer construction) or if enhancer outlived the parent instance somehow. Both cases are considered to be implementation bug.

Parameters:

this

a Reactable

item

a MediaItem

after_item

a MediaItem after which to insert or null to prepend