Skip to content

Commit 78bddb6

Browse files
committed
don't set protocol_whitelist for network source. fix #274
protocol_whitelist was added for #15 to test m3u8 local files. if set it unconditionally, other protocols are unusable if not in the list
1 parent 3045dc4 commit 78bddb6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/src/video_player_mdk.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,12 @@ class MdkVideoPlayerPlatform extends VideoPlayerPlatform {
254254
player.setProperty('avformat.safe', '0');
255255
player.setProperty('avio.reconnect', '1');
256256
player.setProperty('avio.reconnect_delay_max', '7');
257-
player.setProperty('avio.protocol_whitelist',
258-
'file,rtmp,http,https,tls,rtp,tcp,udp,crypto,httpproxy,data,concatf,concat,subfile');
259257
player.setProperty('avformat.rtsp_transport', 'tcp');
258+
if (dataSource.sourceType != DataSourceType.network) {
259+
// for m3u8 local file etc.
260+
player.setProperty('avio.protocol_whitelist',
261+
'file,ftp,rtmp,http,https,tls,rtp,tcp,udp,crypto,httpproxy,data,concatf,concat,subfile');
262+
}
260263
_playerOpts?.forEach((key, value) {
261264
player.setProperty(key, value);
262265
});

0 commit comments

Comments
 (0)