The MediaInfo class is a data model used to represent metadata and properties of a video file. It can be instantiated manually or reconstructed from a JSON map using MediaInfo.fromJson.
Key properties include:
path: The file path (String).title: The video title.author: The video author.width & height: The video dimensions in pixels.orientation: The video orientation (available on Android API level 17+).filesize: The file size in bytes.duration: The video duration in milliseconds.file: A File object corresponding to the path.
// Example of manual instantiation
final info = MediaInfo(
path: '/path/to/video.mp4',
width: 1920,
height: 1080,
duration: 15000.0,
);
// Example of creating from JSON
final json = {
'path': '/path/to/video.mp4',
'duration': '15000',
'width': 1920,
'height': 1080,
};
final infoFromJson = MediaInfo.fromJson(json);