diff --git a/lib/components/commonFun.dart b/lib/components/commonFun.dart index 4cbd996..6cdf067 100644 --- a/lib/components/commonFun.dart +++ b/lib/components/commonFun.dart @@ -160,6 +160,10 @@ String urlnew = bool isVideoUrl(String url, {bool showToast = false}) { print('url = $url'); + if (0 == url.length) { + return false; + } + String prefix = url.substring(0, 4); List list = ['http', 'rtmp', 'rstp']; for (String item in list) { diff --git a/lib/components/dioFun.dart b/lib/components/dioFun.dart index 81ef31a..60d09b9 100644 --- a/lib/components/dioFun.dart +++ b/lib/components/dioFun.dart @@ -2005,9 +2005,12 @@ Future getDwspUrlNew( print('listDwspGetList2 = ${listDwspGetList2}'); print('indexRecord = ${indexRecord}'); - String _dwspUrl = - listDwspGetList2[indexRecord]['play_urlhead'] + listDwspGetList2[indexRecord]['video16']; - print('开始播放:第$getCount次成功获取的视频地址'); + String _dwspUrl = ''; + if (null != listDwspGetList2[indexRecord]['play_urlhead']) { + String _dwspUrl = + listDwspGetList2[indexRecord]['play_urlhead'] + listDwspGetList2[indexRecord]['video16']; + print('开始播放:第$getCount次成功获取的视频地址'); + } if (!isVideoUrl(_dwspUrl)) { Fluttertoast.showToast( @@ -2015,6 +2018,8 @@ Future getDwspUrlNew( toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.CENTER, ); + //正在获取点位视频标志,禁止重入 + getingDwVideo = false; } else { print('开始播放视频地址'); playUrl(index: indexRecord, url: _dwspUrl, context: context);