open method
Opens a Media or Playlist into the Player.
Passing play
as true
starts the playback immediately.
await player.open(Media('asset:///assets/videos/sample.mp4'));
await player.open(Media('file:///C:/Users/Hitesh/Music/Sample.mp3'));
await player.open(
Playlist(
[
Media('file:///C:/Users/Hitesh/Music/Sample.mp3'),
Media('file:///C:/Users/Hitesh/Video/Sample.mkv'),
Media('https://www.example.com/sample.mp4'),
Media('rtsp://www.example.com/live'),
],
),
);
Implementation
Future<void> open(
Playable playable, {
bool play = true,
}) async {
return platform?.open(
playable,
play: play,
);
}