HomeView.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div class="home">
  3. <!-- <img alt="Vue logo" src="../assets/logo.png">
  4. <HelloWorld msg="Welcome to Your Vue.js App"/> -->
  5. <VideoPlayerComponent :videoUrl="videoUrl" :videoType="videoType" />
  6. </div>
  7. </template>
  8. <script>
  9. // @ is an alias to /src
  10. // import HelloWorld from '@/components/HelloWorld.vue'
  11. import VideoPlayerComponent from '@/components/VideoPlayerComponent.vue';
  12. import requestConfig from '@/utils/requestConfig';
  13. export default {
  14. name: 'HomeView',
  15. components: {
  16. // HelloWorld,
  17. VideoPlayerComponent
  18. },
  19. data() {
  20. return {
  21. // https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8
  22. // videoUrl: 'https://gcalic.v.myalicdn.com/gc/zyqcdx01_1/index.m3u8', // HLS 流地址
  23. // videoType: 'hls', // 或 'flv'
  24. // 快手直播里面的
  25. // videoUrl: 'https://ws-origin.pull.yximgs.com/gifshow/kwai_actL_ksle_20250411142108_GwU_strL_hd2000.flv?wsTime=67fa1bac&wsSecret=c09f848b129c9e352a4eab5ce2e06a80&stat=HKoB%2BwNN2oCYt7Rc2VlNANkgzdjg%2BiPBuC2zPQcpCqA6tJusJ0cQ%2BhKEfVoBjqV7&tsc=origin&oidc=watchmen&sidc=2062&no_script=1&srcStrm=lytuRPfcqgM&fd=0&ss=s20&tfc_buyer=0&kabr_spts=-5000', // HLS 流地址
  26. // videoType: 'flv', // 或 'flv'
  27. videoUrl: 'rtmp://36.150.174.132:57935/oss/eHh4eFNfMjQ0ODQ1YmU5MTNkOjg1NTc5NTI2NDAwODI0ODUyODc?deviceId=xxxxS_244845be913d&expireTime=1744858930&playType=0', // HLS 流地址
  28. videoType: 'rtmp', // 或 'flv'
  29. };
  30. },
  31. mounted() {
  32. this.getIpAddr()
  33. },
  34. methods: {
  35. // 获取客户端小程序IP地址
  36. async getIpAddr() {
  37. const res = await requestConfig('getIpAddr', {}, true);
  38. if (res.data && res.data.success && res.data.single) {
  39. // this.globalData.ip = res.single;
  40. console.log("***app.js-onLaunch-getIpAddr***", res.data.single)
  41. }
  42. },
  43. },
  44. }
  45. </script>