source static method

UMediaSource source(
  1. Object input
)

Implementation

static UMediaSource source(Object input) {
  if (input is UMediaSource) return input;
  final String value = input.toString();
  if (value.startsWith("http://") || value.startsWith("https://") || value.startsWith("rtsp://") || value.startsWith("rtmp://")) return UMediaSource.network(value);
  if (value.startsWith("content://") || value.startsWith("file://")) return UMediaSource.content(value);
  if (value.startsWith("assets/") || value.startsWith("asset:")) return UMediaSource.asset(value.replaceFirst("asset:", ""));
  return UMediaSource.file(value);
}