livePlayerType method

TX_Enum_PlayType? livePlayerType(
  1. String url
)

Implementation

TX_Enum_PlayType? livePlayerType(String url){
  TX_Enum_PlayType? type;
  Uri uri = Uri.parse(url);
  if (Platform.isAndroid) {
    type = TX_Enum_PlayType.PLAY_TYPE_VOD_HLS;
  }else if (uri.scheme.toLowerCase() == "rtmp") {
    type = TX_Enum_PlayType.PLAY_TYPE_LIVE_RTMP;
  }else if(uri.scheme.startsWith("http") && uri.path.toLowerCase().endsWith("flv")){
    type = TX_Enum_PlayType.PLAY_TYPE_LIVE_FLV;
  }else if(uri.scheme.startsWith("http") && uri.path.toLowerCase().endsWith("m3u8")){
    type = TX_Enum_PlayType.PLAY_TYPE_VOD_HLS;
  }
  return type;
}