Skip to main content Link Search Menu Expand Document (external link)

PlayerItem

Player Items allow control of elements like audio players, televisions, etc. All methods of the underlying OpenHAB Player Item exist along with Ruby like method / extensions

MethodDescriptionExample
playSend PLAY command to itemitem.play
pauseSend PAUSE command to itemitem.pause
rewindSend REWIND command to itemitem.rewind
fast_forwardSend FASTFORWARD command to itemitem.fast_forward
nextSend NEXT command to itemitem.next
previousSend PREVIOUS command to itemitem.previous
playing?Returns true if item state == PLAYputs "#{item.name} is playing" if item.playing?
paused?Returns true if item state == PAUSEDputs "#{item.name} is paused" if item.paused?
rewinding?Returns true if item state == REWINDputs "#{item.name} is rewinding" if item.rewinding?
fast_forwarding?Returns true if item state == FASTFORWARDputs "#{item.name} is fast forwarding" if item.fast_forwarding?

Examples

Start play on a player item

Chromecast.play

Check if a player is paused

logger.warn("#{item.id} is paused) if Chromecast.paused?