parseStreamURL method
Get parsed local stream url by passing the original stream url(m3u8) to CBP2pEngine instance.
Implementation
@override
Future<String> parseStreamURL(
String sourceUrl, {
String? videoId,
Duration Function()? bufferedDurationGenerator,
}) async {
if (_bufferedDurationGeneratorEnable && bufferedDurationGenerator == null) {
throw 'Must provide bufferedDurationGenerator if bufferedDurationGeneratorEnable was set true';
}
if (!_bufferedDurationGeneratorEnable &&
bufferedDurationGenerator != null) {
throw 'Must set bufferedDurationGeneratorEnable true before set bufferedDurationGenerator';
}
_bufferedDurationGenerator = bufferedDurationGenerator;
final String url = await _channel.invokeMethod('parseStreamURL', {
'url': sourceUrl,
'videoId': videoId ?? sourceUrl,
});
// print('mobile parse R:$url S:$sourceUrl ');
return url;
}