AliPlayerWidgetData.fromUrl constructor
AliPlayerWidgetData.fromUrl({})
使用URL创建播放器数据的便捷构造函数
Convenience constructor to create player data using a URL
Implementation
factory AliPlayerWidgetData.fromUrl({
required String videoUrl,
SceneType sceneType = SceneType.vod,
String coverUrl = "",
String videoTitle = "",
String thumbnailUrl = "",
bool autoPlay = true,
int startTime = 0,
int seekMode = FlutterAvpdef.ACCURATE,
bool allowedScreenSleep = false,
bool isHardWareDecode = true,
}) {
return AliPlayerWidgetData(
videoSource: VideoSourceFactory.createUrlSource(videoUrl),
sceneType: sceneType,
coverUrl: coverUrl,
videoTitle: videoTitle,
thumbnailUrl: thumbnailUrl,
autoPlay: autoPlay,
startTime: startTime,
seekMode: seekMode,
allowedScreenSleep: allowedScreenSleep,
isHardWareDecode: isHardWareDecode,
);
}