Media Info
- TypeScript
- C#
type MediaType =
| 'image'
| 'music'
| 'unknown'
| 'video'
type MediaPlaybackStatus =
| 'changing'
| 'closed'
| 'opened'
| 'paused'
| 'playing'
| 'stopped'
type MediaPlaybackRepeatMode =
| 'list'
| 'none'
| 'track'
type MediaInfoPayload = {
type: MediaType
title: string
album: string
cover?: ImageContentPayload
trackCount: number
trackNumber: number
artist: string
genres: string[]
status: MediaPlaybackStatus
repeatMode: MediaPlaybackRepeatMode
shuffle: boolean
rate: number
duration: number
position: number
}
struct MediaInfoPayload
{
public string Type;
public string Title;
public string Album;
public ImageContentPayload? Cover;
public int TrackCount;
public int TrackNumber;
public string Artist;
public string[] Genres;
public string Status;
public string RepeatMode;
public bool Shuffle;
public double Rate;
public int Duration;
public int Position;
}
tip
The Type
could be mapped to MediaPlaybackType
enum.
The Status
could be mapped to MediaPlaybackStatus
enum.
The RepeatMode
could be mapped to MediaPlaybackAutoRepeatMode
enum.
This data is sent when the currently playing media changes or the progress of the current media changes.
info
The cover
is usually a data URL.