Para Music Web Player
By using the Para Music Web Player component, you can add a more user-friendly music player in your World, enabling players to pick a song and control its playback more conveniently.
This component provides the following capabilities:
- Allows built-in URLs, functioning as the default playlist that will automatically play.
- Provides built-in web viewers, enabling players to open YouTube and add songs to the playlist in a World.
- Allows players to control and edit the playlist when used together with the 2D UI component (UIMusicControl).
Component Property Descriptions
Parameter Name | Type | Default Value | Parameter Description |
---|---|---|---|
Is Sync | bool | true | Specifies whether to synchronize music playback settings to all players in a room. For example, when a player switches to another song or adjusts the volume, it will be applied to all the other players in the room. |
Init Url List | Array | nil | Indicates the playlist array, which is used to configure default songs in the playlist. - A YouTube URL is configured in each element. |
AllowGuestControl | bool | false | Specifies whether to allow playlist operations by non-master players. |
Play Type | Enum | List Loop | Specifies the playback order of the playlist. - Play in order: Play In Order - Play in a random order: Shuffle Playback - Play a song repeatedly: Single Loop - Play songs in the playlist repeatedly: List Loop |
Notes
- Different from Para Music Player, Para Music Web Player does not support custom audio sources. It plays 2D audio sources and does not support 3D sources, so sound effects cannot change with distance in a World.
- If you want to have 3D music effects, use Para Music Player or Unity Audio Source.
How to Associate 2D UI with Para Music Web Player
As shown in the figure above, drag the player GameObject to the field circled in red to complete association.
Example Description
Access the following prefab in the SDK to learn the complete example: Assets/ParaWorldSDK/Examples/ParaMusicPlayer/Prefab/ParaMusicPlayer.prefab
The example will show you how to perform the following operations:
- Open the 2D UI by using the 2D button in the upper right corner or 3D jukebox model in a scene.
- Control the playlist through the 2D UI.
Attention
Currently, only one Para Video Player or Para Music Web Player component can be placed in a world. Otherwise, errors may occur on some device models. This also means that you can only have one example file of a video player or web music player in the world.
Updated 11 months ago