fullscreen-video.uvue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view style="flex:1">
  3. <view ref="back" @click="back" class="nav-back">
  4. <image class="back-img" src="/static/template/scroll-fold-nav/back.png" mode="widthFix"></image>
  5. </view>
  6. <video ref="video" class="video-box" :src="url" controls="false" autoplay="true" show-progress="false"
  7. show-fullscreen-btn="false" show-play-btn="false" show-center-play-btn="false"></video>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. url: "",
  15. coverPath: ""
  16. }
  17. },
  18. onLoad(options : OnLoadOptions) {
  19. uni.$once("__ONRECEIVEURL",(value:UTSJSONObject)=>{
  20. this.url = value["url"] as string;
  21. this.coverPath = value["cover"] as string;
  22. })
  23. uni.$emit("__ONFULLVIDEOLOAD",null)
  24. },
  25. methods: {
  26. back() {
  27. uni.navigateBack()
  28. }
  29. }
  30. }
  31. </script>
  32. <style>
  33. .nav-back {
  34. position: absolute;
  35. /* #ifdef APP */
  36. top: 35px;
  37. /* #endif */
  38. background-color: rgba(220, 220, 220, 0.8);
  39. border-radius: 100px;
  40. margin: 6px;
  41. width: 32px;
  42. height: 32px;
  43. justify-content: center;
  44. align-items: center;
  45. z-index: 10;
  46. }
  47. .nav-back .back-img {
  48. width: 18px;
  49. height: 18px;
  50. }
  51. .video-box {
  52. width: 100%;
  53. flex: 1;
  54. height: 100%;
  55. }
  56. </style>