Media class
A media object to open inside a Player.
Pass true
to parse for retrieving the metadata of the Media.
timeout
sets the time-limit for retriveing metadata.
Media.metas can be then, accessed to get the retrived metadata as Map<String, String>
.
Media media = Media.file(File('C:/music.ogg'));
Media media = Media.network('http://alexmercerind.github.io/music.mp3');
For starting a Media at particular time, one can pass startTime
.
Media media = Media.file(
File('C:/music.ogg'),
startTime: Duration(milliseconds: 20),
);
- Implemented types
Constructors
- Media.asset(String asset, {dynamic startTime = Duration.zero})
-
Makes Media object from assets.
factory
-
Media.directShow({String? rawUrl, Map<
String, dynamic> ? args, String? vdev, String? adev, int? liveCaching}) -
Makes Media object from direct show.
factory
-
Media.file(File file, {bool parse = false, Map<
String, dynamic> ? extras, Duration timeout = const Duration(seconds: 10), dynamic startTime = Duration.zero, dynamic stopTime = Duration.zero}) -
Makes Media object from a File.
factory
-
Media.network(dynamic url, {bool parse = false, Map<
String, dynamic> ? extras, Duration timeout = const Duration(seconds: 10), dynamic startTime = Duration.zero, dynamic stopTime = Duration.zero}) -
Makes Media object from url.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- mediaSourceType → MediaSourceType
-
no setter
- mediaType → MediaType
-
final
-
metas
→ Map<
String, String> -
final
- resource → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startTime → Duration
-
final
- stopTime → Duration
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
Duration timeout) → void - Parses the Media to retrieve Media.metas.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited