fromJson static method

TTVideoEngineMediaSource fromJson(
  1. String jsonStr
)

Implementation

static TTVideoEngineMediaSource fromJson(String jsonStr) {
  Map<String, dynamic> json = jsonDecode(jsonStr);
  if (json['sourceType'] == 1) {
    TTVideoEngineMediaSource source = TTVideoEngineUrlSource.fromJsonToMediaSource(json);
    return source;
  }
  throw UnimplementedError("only support DirectUrlSource for now! $jsonStr");
}