setDataSource
Sets a video file as the data source for the player.
Ensure the player is valid before calling this method, otherwise it will throw an IllegalStateException.
Return
true if the data source is set successfully; false otherwise.
Parameters
The path to the video file. It can be a storage path (not Android assets) or a URL. or url path.
Sets a video file as the data source using a file descriptor, offset, and length. It is safe to close the file descriptor after setting the data source.
Ensure the player is valid before calling this method, otherwise it will throw an IllegalStateException.
Return
true if the data source is set successfully; false otherwise.
Parameters
The file descriptor of the video file.
The offset of the video file.
the length of the video file.
Sets a video file as the data source using an AssetFileDescriptor. It is safe to close the AssetFileDescriptor after setting the data source.
Ensure the player is valid before calling this method, otherwise it will throw an IllegalStateException.
Return
true if the data source is set successfully; false otherwise.
Parameters
The AssetFileDescriptor of the video file.