MediaPlayer

MediaPlayerコンポーネントのドキュメントと例。

いつ使用するか

  • メディアプレーヤーコンポーネントは、オーディオまたはビデオコンテンツの再生を制御するために使用できます。メディアの再生、一時停止、およびシークのための標準インターフェイスを提供します。

使用例

Night Drive cover

Night Drive

Synthwave Dream

1:45 -2:15

状態と外観

`isPlaying`と`isLiked`プロパティを使用して、プレーヤーの視覚的な状態を制御できます。

Morning Coffee cover

Morning Coffee

Lofi Chill

0:45 -3:15

API リファレンス

プロパティ
説明
タイプ
デフォルト

title

The title of the currently playing track. string 'Unknown Track'

artist

The artist of the currently playing track. string 'Unknown Artist'

coverImage

The URL for the album cover or thumbnail image. string '/designs/18.png'

progress

The current playback progress percentage (0-100). number 33

currentTime

The formatted current playback time string (e.g., "1:23"). string '1:23'

totalTime

The formatted total or remaining time string (e.g., "-2:37"). string '-2:37'

isPlaying

Whether the media is currently playing. Toggles the play/pause icon. boolean false

isLiked

Whether the media is liked/favorited. Toggles the heart icon style. boolean false

class

Additional CSS classes to apply to the container. string -