From 98630c757b039b8e1b0843fb7bc8baaf27ec81dc Mon Sep 17 00:00:00 2001 From: WinUser01 Date: Mon, 20 Dec 2021 20:40:49 +0800 Subject: [PATCH] =?UTF-8?q?hyzp=5Fybqx-Commit039=EF=BC=9A=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E8=A7=A3=E5=86=B3=E8=8E=B7=E5=8F=96=E7=82=B9=E4=BD=8D?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=9C=B0=E5=9D=80=E5=A4=B1=E8=B4=A5=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/commonFun.dart | 4 ++++ lib/components/dioFun.dart | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) 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);