videoPlayer.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view id="videoPlayer">
  3. <!-- <web-view src="http://10.111.224.196:8080/?type=4&id=1793100035379396609"></web-view> -->
  4. <web-view :src="webViewUrl" v-if="pageType"></web-view>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. pageType:false,
  12. webViewUrl:'',
  13. }
  14. },
  15. onLoad(option) {
  16. let obj = JSON.parse(decodeURIComponent(option.item))
  17. console.log('obj',obj)
  18. let url = '';
  19. // if(obj.type == 4){
  20. // url = uni.getStorageSync('cameraExtranetAgent')+'?source=2&mpegts=true&type=4&subId='+obj.subId+'&touken='+uni.getStorageSync('token')
  21. // }else if(obj.type == 5){
  22. // url = uni.getStorageSync('cameraExtranetAgent')+'?source=5&mpegts=true&type=5&floorId='+obj.floorId+'&subId='+obj.subId+'&touken='+uni.getStorageSync('token')
  23. // }
  24. if(obj.type == 4){
  25. url = uni.getStorageSync('cameraExtranetAgent')+'?mpegts=true&source=2&type=4&subId='+obj.subId+'&touken='+uni.getStorageSync('token')
  26. }else if(obj.type == 5){
  27. url = uni.getStorageSync('cameraExtranetAgent')+'?mpegts=true&source=5&type=5&floorId='+obj.floorId+'&subId='+obj.subId+'&touken='+uni.getStorageSync('token')
  28. }
  29. this.$set(this,'webViewUrl',url);
  30. this.$set(this,'pageType',true);
  31. },
  32. onShow(){
  33. },
  34. methods: {
  35. }
  36. }
  37. </script>
  38. <style lang="stylus" scoped>
  39. #videoPlayer{
  40. height: 100%;
  41. display flex;
  42. flex-direction column;
  43. }
  44. </style>