A list widget that combines track, artist, playback service, and play controls into one widget. The widget is based on the Channels provided by the Chromecast binding but should support most media players. When the player is idling, the widget will be hidden.
The widget has the following properties:
Property | Purpose |
---|---|
Player Name | Used as the title of the widget, if not defined there will be no title. |
Item Prefix | An optional Item name prefix which is used to generate the names of all the Items based on the naming scheme below. If you use this property you do not need to select the individual Items. If you use this property you can override the prefix with a different Item name by selecting the individual Item below. âUnknownâ will be shown in the widget if neither the prefix nor the Item is selected. |
Application | Select the String Item that has the name of the application currently playing media on the device. Selecting this overrides the prefix Item if the prefix is set. |
Media Title | Select the String Item that has the title of the media currently playing. Selecting this overrides the prefix Item if the prefix is set. |
Media Artist | Select the String Item that has the artist of the media currently playing. Selecting this overrides the prefix Item if the prefix is set. |
Media Control | Select the Player Item that controls the media playback. Selecting this overrides the prefix Item if the prefix is set. |
Visibility | Select the Switch Item which, when ON , should cause this widget to be hidden. If neither the prefix nor this property are set, the widget is always shown and never hidden. |
The widget can work using an Item name prefix so you must name your Items with a common prefix. The last part of the name of the Items should be:
<Prefix>_MediaTitle
: name of the media playing<Prefix>_MediaArtist
: name of the artist<Prefix>_Idling
: Switch Item that is set to true when the player is not playing anything<Prefix>_App
: The name of the app currently playing<Prefix>_MediaControl
: a Player type Item to control play, pause, fast forward and rewind
Note, the prefix property and this naming scheme is kept for backwards compatibility. When using the default naming schemes for Items when generating Items using âadd equipment from thingâ et al the naming of the Items is actually different now using _
instead of camel case. So the prefix property will mainly be useful for legacy users of this widget.
Changelog
Version 0.2
- Updated to use the new(ish)
@
syntax for getting the Item states - Added properties to individually select the Items that go for each property.
- If no visibility Item and no prefix is defined, visibility is set to always show the widget.
Version 0.1
- initial release
Resources
uid: rlk_media_control_list
tags:
- list
- media
props:
parameters:
- description: Player name
label: Name
name: name
required: false
type: TEXT
- description: An optional prefix to item names instead of selecting all the items individually. The names need to be the prefix plus _MediaTitle, _MediaArtist, _Idling, _App, and _MediaControl.
label: Item Prefix
name: prefix
required: false
type: TEXT
- context: item
description: String item with the name of the application currently playing media that is used when prefix is not defined.
label: Application
name: app
required: false
type: TEXT
filterCriteria:
- value: String
name: type
- context: item
description: String item with the title of the media currently playing that is used when prefix is not defined.
label: Media Title
name: title
required: false
type: TEXT
filterCriteria:
- value: String
name: type
- context: item
description: String item with the artist of the media currently playing that is used when prefix is not defined.
label: Media Artist
name: artist
required: false
type: TEXT
filterCriteria:
- value: String
name: type
- context: item
description: Player item that can control this device that is used when prefix is not defined.
label: Media Control
name: control
required: false
type: TEXT
filterCriteria:
- value: Player
name: type
- context: item
description: Switch item that controls the visibility of this widget. When the Item is OFF the widget is hidden that is used when prefix is not defined.. If both the prefix and this property are undefined the default is to always show the widget.
label: Visibility
name: visibility
required: false
type: TEXT
filterCriteria:
- value: Switch
name: type
timestamp: Feb 7, 2024, 1:35:04 PM
component: oh-player-item
config:
icon: f7:hifispeaker
iconColor: black
title: '=(props.name === undefined) ? "" : props.name'
subtitle: '=((props.title !== undefined) ? @props.title : (props.prefix !== undefined) ? @(props.prefix + "_MediaTitle") : "unknown") + " by " + ((props.artist !== undefined) ? @props.artist :(props.prefix !== undefined) ? @(props.prefix + "_MediaArtist") : "unknown")'
visible: '=(props.visibility !== undefined) ? (items[props.visibility].state != "ON") : (props.prefix !== undefined) ? (items[props.prefix + "_Idling"].state != "ON") : true'
trackItem: '=(props.title !== undefined) ? props.title : (props.prefix !== undefined) ? props.prefix + "_MediaTitle" : ""'
after: '=(props.app !== undefined) ? @props.app : (props.prefix !== undefined) ? @(props.prefix + "_App") : "unknown"'
artistItem: '=(props.prefix !== undefined) ? props.prefix + "_MediaArtist" : ""'
showRewindFFward: false
item: '=(props.control) ? props.control : (props.prefix !== undefined) ? props.prefix + "_MediaControl" : ""'