videoPlayer.vue 912 B

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