AliPlayerWidgetData.fromUrl constructor

  1. @Deprecated('Use videoSource instead.')
AliPlayerWidgetData.fromUrl({
  1. required String videoUrl,
  2. SceneType sceneType = SceneType.vod,
  3. String coverUrl = "",
  4. String videoTitle = "",
  5. String thumbnailUrl = "",
  6. bool autoPlay = true,
  7. String traceId = "",
  8. int startTime = 0,
  9. int seekMode = FlutterAvpdef.ACCURATE,
  10. bool allowedScreenSleep = false,
  11. bool isHardWareDecode = true,
  12. SubtitleConfig subtitleConfig = const SubtitleConfig(),
  13. SubtitleBuilder? subtitleBuilder,
  14. SubtitlePositionConfig? subtitlePositionConfig,
})

使用URL创建播放器数据的便捷构造函数

Convenience constructor to create player data using a URL

This method will be removed in a future release.

Implementation

@Deprecated('Use videoSource instead.')
factory AliPlayerWidgetData.fromUrl({
  required String videoUrl,
  SceneType sceneType = SceneType.vod,
  String coverUrl = "",
  String videoTitle = "",
  String thumbnailUrl = "",
  bool autoPlay = true,
  String traceId = "",
  int startTime = 0,
  int seekMode = FlutterAvpdef.ACCURATE,
  bool allowedScreenSleep = false,
  bool isHardWareDecode = true,
  SubtitleConfig subtitleConfig = const SubtitleConfig(),
  SubtitleBuilder? subtitleBuilder,
  SubtitlePositionConfig? subtitlePositionConfig,
}) {
  return AliPlayerWidgetData(
    videoSource: VideoSourceFactory.createUrlSource(videoUrl),
    sceneType: sceneType,
    coverUrl: coverUrl,
    videoTitle: videoTitle,
    thumbnailUrl: thumbnailUrl,
    autoPlay: autoPlay,
    traceId: traceId,
    startTime: startTime,
    seekMode: seekMode,
    allowedScreenSleep: allowedScreenSleep,
    isHardWareDecode: isHardWareDecode,
    subtitleConfig: subtitleConfig,
    subtitleBuilder: subtitleBuilder,
    subtitlePositionConfig: subtitlePositionConfig,
  );
}