McPlayer class

McPlayer is a utility class for creating video player widgets from different sources.

It provides static methods for creating a McVideoPlayer widget for:

  • Network Videos: Use the network method with a URL to play videos from the network.
  • Local Files: Use the file method with a File object to play videos stored locally.
  • Assets: Use the asset method with a path to play videos bundled with the app.

Example Usage:

McPlayer.network(url: 'https://example.com/video.mp4');

// For local file
McPlayer.file(file: File('/path/to/video.mp4'));

// For asset video
McPlayer.asset(path: 'assets/videos/video.mp4');

Constructors

McPlayer()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

asset({required String path}) → Widget
Creates a McVideoPlayer widget for an asset video.
file({required File file}) → Widget
Creates a McVideoPlayer widget for a local video file.
network({required String url}) → Widget
Creates a McVideoPlayer widget for a network video.