getMediaStreamResponse method
Future<Response>
getMediaStreamResponse({
- required String filePath,
- BaiduMediaRequestType type = BaiduMediaRequestType.M3U8_AUTO_1080,
Implementation
Future<http.Response> getMediaStreamResponse({
required String filePath,
BaiduMediaRequestType type = BaiduMediaRequestType.M3U8_AUTO_1080,
}) async {
final path = 'rest/2.0/xpan/file';
final param = <String, String>{
'method': 'streaming',
'path': filePath,
'access_token': accessToken,
'type': type.value,
};
final header = <String, String>{
'User-Agent': 'xpanvideo;netdisk;iPhone13;ios-iphone;15.1;ts',
'host': 'pan.baidu.com',
};
return _getResponse(
path,
params: param,
headers: header,
);
}