|
@@ -11,8 +11,17 @@
|
|
v-html="html"
|
|
v-html="html"
|
|
v-show="detail.status" ref="videoWrapHls">
|
|
v-show="detail.status" ref="videoWrapHls">
|
|
|
|
|
|
|
|
+ </view>
|
|
|
|
+ <!-- -->
|
|
|
|
+ <view style=" text-align: center;" v-if="endTime">
|
|
|
|
+ <u-button
|
|
|
|
+ type="primary" size="medium"
|
|
|
|
+ @click="getInfo" >继续播放</u-button>
|
|
|
|
+ </view>
|
|
|
|
+ <view style="padding: 10px ;" v-if="endTime">
|
|
|
|
+ 单次播放时间为{{expireTime/60}}分钟;<br/>
|
|
|
|
+ 过期后可点击“继续播放”
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -32,7 +41,8 @@
|
|
detail: {},
|
|
detail: {},
|
|
hls: null,
|
|
hls: null,
|
|
player: null,
|
|
player: null,
|
|
- expireTime:1000*60*10
|
|
|
|
|
|
+ expireTime:10*60,
|
|
|
|
+ endTime:0,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(op) {
|
|
onLoad(op) {
|
|
@@ -59,17 +69,30 @@
|
|
title: "加载中",
|
|
title: "加载中",
|
|
mask: true,
|
|
mask: true,
|
|
})
|
|
})
|
|
|
|
+ //秒
|
|
this.subForm.expireTime=this.expireTime
|
|
this.subForm.expireTime=this.expireTime
|
|
API.cameraDetail(this.subForm).then((res) => {
|
|
API.cameraDetail(this.subForm).then((res) => {
|
|
this.detail=res.data.cameraInfo;
|
|
this.detail=res.data.cameraInfo;
|
|
|
|
+ this.endTime=0;
|
|
|
|
+ if(this.detail.status&&res.data.liveJson){
|
|
|
|
+ var myVideoSource =document.getElementById("myVideoSource")
|
|
|
|
+
|
|
|
|
+ myVideoSource.src=this.liveAddressUrl;
|
|
|
|
+
|
|
|
|
+ this.liveAddressUrl = res.data.liveJson.url
|
|
|
|
+
|
|
|
|
+ var endTime=new Date(res.data.liveJson.expireTime).getTime()
|
|
|
|
+ var nowTime=new Date().getTime()
|
|
|
|
+
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.endTime=1;
|
|
|
|
+ },endTime-nowTime)
|
|
|
|
+
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
+ this.play();
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
- this.liveAddressUrl = res.data.liveJson.url
|
|
|
|
-
|
|
|
|
- var myVideoSource =document.getElementById("myVideoSource")
|
|
|
|
- myVideoSource.src=this.liveAddressUrl;
|
|
|
|
- this.$nextTick(()=>{
|
|
|
|
- this.play();
|
|
|
|
- })
|
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
|
|
|
|
|
|