CloudRecordVideoDlg.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div :class="['modal', { fade: fade }]" data-keyboard="true" data-backdrop="static" tabindex="-1">
  3. <div class="modal-dialog modal-lg">
  4. <div class="modal-content">
  5. <div class="modal-header">
  6. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  7. <span aria-hidden="true">&times;</span>
  8. </button>
  9. <h4 class="modal-title text-primary text-center"><span>{{videoTitle}}</span></h4>
  10. </div>
  11. <div class="modal-body" v-loading="bLoading" element-loading-text="加载中">
  12. <LivePlayer v-if="bShow" :videoUrl="videoUrl" :snapUrl="snapUrl" :live="live" @message="$message" :loading.sync="bLoading"></LivePlayer>
  13. <div class="text-center" v-if="isDemoUser(serverInfo, userInfo)">
  14. <br>
  15. 提示: 演示系统限制匿名登录播放时间, 若需测试长时间播放, 请<a target="_blank" href="//www.liveqing.com/docs/download/LiveGBS.html">下载使用</a>
  16. </div>
  17. </div>
  18. <div class="modal-footer">
  19. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import 'jquery-ui/ui/widgets/draggable'
  27. import LivePlayer from '@liveqing/liveplayer'
  28. import { mapState } from "vuex"
  29. export default {
  30. data() {
  31. return {
  32. videoUrl: "",
  33. videoTitle: "",
  34. snapUrl: "",
  35. bShow: false,
  36. bLoading: false
  37. }
  38. },
  39. props: {
  40. live : {
  41. type: Boolean,
  42. default: false
  43. },
  44. fade: {
  45. type: Boolean,
  46. default: false
  47. }
  48. },
  49. mounted() {
  50. $(this.$el).find('.modal-content').draggable({
  51. handle: '.modal-header',
  52. cancel: ".modal-title span",
  53. addClasses: false,
  54. containment: 'document',
  55. delay: 100,
  56. opacity: 0.5
  57. });
  58. $(this.$el).on("hide.bs.modal", () => {
  59. this.bShow = false;
  60. }).on("show.bs.modal", () => {
  61. this.bShow = true;
  62. })
  63. },
  64. components: { LivePlayer },
  65. computed: {
  66. ...mapState(['userInfo', 'serverInfo']),
  67. },
  68. methods: {
  69. play(src,title,snap) {
  70. this.videoUrl = src||"";
  71. this.videoTitle = title||"";
  72. this.snapUrl = snap||"";
  73. $(this.$el).modal("show");
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="less" scoped>
  79. .modal-title {
  80. overflow: hidden;
  81. white-space: nowrap;
  82. text-overflow: ellipsis;
  83. }
  84. </style>