await self._get_snapgroup(player_id).set_stream("default")
self._handle_update()
- async def play_media(
- self,
- player_id: str,
- queue_item: QueueItem,
- seek_position: int,
- fade_in: bool,
- ) -> None:
- """Handle PLAY MEDIA on given player.
-
- This is called by the Queue controller to start playing a queue item on the given player.
- The provider's own implementation should work out how to handle this request.
-
- - player_id: player_id of the player to handle the command.
- - queue_item: The QueueItem that needs to be played on the player.
- - seek_position: Optional seek to this position.
- - fade_in: Optionally fade in the item at playback start.
- """
+ async def play_media(self, player_id: str, queue_item: QueueItem) -> None:
+ """Handle PLAY MEDIA on given player."""
player = self.mass.players.get(player_id)
if player.synced_to:
msg = "A synced player cannot receive play commands directly"
queue,
start_queue_item=queue_item,
pcm_format=pcm_format,
- seek_position=seek_position,
- fade_in=fade_in,
)
async def _streamer() -> None:
self,
player_id: str,
queue_item: QueueItem,
- seek_position: int,
- fade_in: bool,
) -> None:
- """Handle PLAY MEDIA on given player.
-
- This is called by the Queue controller to start playing a queue item on the given player.
- The provider's own implementation should work out how to handle this request.
-
- - player_id: player_id of the player to handle the command.
- - queue_item: The QueueItem that needs to be played on the player.
- - seek_position: Optional seek to this position.
- - fade_in: Optionally fade in the item at playback start.
- """
+ """Handle PLAY MEDIA on given player."""
# power ON
await self.cmd_power(player_id, True)
group_player = self.mass.players.get(player_id)
stream_job = await self.mass.streams.create_multi_client_stream_job(
player_id,
start_queue_item=queue_item,
- seek_position=seek_position,
- fade_in=fade_in,
)
# create a fake queue item to forward to downstream play_media commands
ugp_queue_item = QueueItem(
member = self.mass.players.get_sync_leader(member) # noqa: PLW2901
if member is None:
continue
- tg.create_task(player_prov.play_media(member.player_id, ugp_queue_item, 0, False))
+ tg.create_task(player_prov.play_media(member.player_id, ugp_queue_item))
stream_job.start()
async def poll_player(self, player_id: str) -> None: