devicePlayer.vue 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180
  1. <template>
  2. <div id="devicePlayer" v-loading="isLoging">
  3. <el-dialog title="视频播放" top="0" :close-on-click-modal="false" :visible.sync="showVideoDialog" :destroy-on-close="true" @close="close()">
  4. <!-- <LivePlayer v-if="showVideoDialog" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" :message="videoError" :hasaudio="hasaudio" fluent autoplay live></LivePlayer> -->
  5. <div style="width: 100%; height: 100%">
  6. <el-tabs type="card" :stretch="true" v-model="activePlayer" @tab-click="changePlayer" v-if="Object.keys(this.player).length > 1">
  7. <el-tab-pane label="Jessibuca" name="jessibuca">
  8. <jessibucaPlayer v-if="activePlayer === 'jessibuca'" ref="jessibuca" :visible.sync="showVideoDialog" :videoUrl="videoUrl" :error="videoError" :message="videoError" height="100px" :hasAudio="hasAudio" fluent autoplay live ></jessibucaPlayer>
  9. </el-tab-pane>
  10. <el-tab-pane label="WebRTC" name="webRTC">
  11. <rtc-player v-if="activePlayer === 'webRTC'" ref="webRTC" :visible.sync="showVideoDialog" :videoUrl="videoUrl" :error="videoError" :message="videoError" height="100px" :hasAudio="hasAudio" fluent autoplay live ></rtc-player>
  12. </el-tab-pane>
  13. <el-tab-pane label="h265web">h265web敬请期待</el-tab-pane>
  14. <el-tab-pane label="wsPlayer">wsPlayer 敬请期待</el-tab-pane>
  15. </el-tabs>
  16. <jessibucaPlayer v-if="Object.keys(this.player).length == 1 && this.player.jessibuca" ref="jessibuca" :visible.sync="showVideoDialog" :videoUrl="videoUrl" :error="videoError" :message="videoError" height="100px" :hasAudio="hasAudio" fluent autoplay live ></jessibucaPlayer>
  17. <rtc-player v-if="Object.keys(this.player).length == 1 && this.player.webRTC" ref="jessibuca" :visible.sync="showVideoDialog" :videoUrl="videoUrl" :error="videoError" :message="videoError" height="100px" :hasAudio="hasAudio" fluent autoplay live ></rtc-player>
  18. </div>
  19. <div id="shared" style="text-align: right; margin-top: 1rem;">
  20. <el-tabs v-model="tabActiveName" @tab-click="tabHandleClick" >
  21. <el-tab-pane label="实时视频" name="media">
  22. <div style="margin-bottom: 0.5rem;">
  23. <!-- <el-button type="primary" size="small" @click="playRecord(true, '')">播放</el-button>-->
  24. <!-- <el-button type="primary" size="small" @click="startRecord()">录制</el-button>-->
  25. <!-- <el-button type="primary" size="small" @click="stopRecord()">停止录制</el-button>-->
  26. </div>
  27. <div style="display: flex; margin-bottom: 0.5rem; height: 2.5rem;">
  28. <span style="width: 5rem; line-height: 2.5rem; text-align: right;">播放地址:</span>
  29. <el-input v-model="getPlayerShared.sharedUrl" :disabled="true" >
  30. <template slot="append">
  31. <i class="cpoy-btn el-icon-document-copy" title="点击拷贝" v-clipboard="getPlayerShared.sharedUrl" @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></i>
  32. </template>
  33. </el-input>
  34. </div>
  35. <div style="display: flex; margin-bottom: 0.5rem; height: 2.5rem;">
  36. <span style="width: 5rem; line-height: 2.5rem; text-align: right;">iframe:</span>
  37. <el-input v-model="getPlayerShared.sharedIframe" :disabled="true" >
  38. <template slot="append">
  39. <i class="cpoy-btn el-icon-document-copy" title="点击拷贝" v-clipboard="getPlayerShared.sharedIframe" @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></i>
  40. </template>
  41. </el-input>
  42. </div>
  43. <div style="display: flex; margin-bottom: 0.5rem; height: 2.5rem;">
  44. <span style="width: 5rem; line-height: 2.5rem; text-align: right;">资源地址:</span>
  45. <el-input v-model="getPlayerShared.sharedRtmp" :disabled="true" >
  46. <el-button slot="append" icon="el-icon-document-copy" title="点击拷贝" v-clipboard="getPlayerShared.sharedRtmp" @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>
  47. <el-dropdown slot="prepend" v-if="streamInfo" trigger="click" @command="copyUrl">
  48. <el-button >
  49. 更多地址<i class="el-icon-arrow-down el-icon--right"></i>
  50. </el-button>
  51. <el-dropdown-menu slot="dropdown" >
  52. <el-dropdown-item :command="streamInfo.flv">
  53. <el-tag >FLV:</el-tag>
  54. <span>{{ streamInfo.flv }}</span>
  55. </el-dropdown-item>
  56. <el-dropdown-item :command="streamInfo.https_flv">
  57. <el-tag >FLV(https):</el-tag>
  58. <span>{{ streamInfo.https_flv }}</span>
  59. </el-dropdown-item>
  60. <el-dropdown-item :command="streamInfo.ws_flv">
  61. <el-tag >FLV(ws):</el-tag>
  62. <span >{{ streamInfo.ws_flv }}</span>
  63. </el-dropdown-item>
  64. <el-dropdown-item :command="streamInfo.wss_flv">
  65. <el-tag >FLV(wss):</el-tag>
  66. <span>{{ streamInfo.wss_flv }}</span>
  67. </el-dropdown-item>
  68. <el-dropdown-item :command="streamInfo.fmp4">
  69. <el-tag >FMP4:</el-tag>
  70. <span>{{ streamInfo.fmp4 }}</span>
  71. </el-dropdown-item>
  72. <el-dropdown-item :command="streamInfo.https_fmp4">
  73. <el-tag >FMP4(https):</el-tag>
  74. <span>{{ streamInfo.https_fmp4 }}</span>
  75. </el-dropdown-item>
  76. <el-dropdown-item :command="streamInfo.ws_fmp4">
  77. <el-tag >FMP4(ws):</el-tag>
  78. <span>{{ streamInfo.ws_fmp4 }}</span>
  79. </el-dropdown-item>
  80. <el-dropdown-item :command="streamInfo.wss_fmp4">
  81. <el-tag >FMP4(wss):</el-tag>
  82. <span>{{ streamInfo.wss_fmp4 }}</span>
  83. </el-dropdown-item>
  84. <el-dropdown-item :command="streamInfo.hls">
  85. <el-tag>HLS:</el-tag>
  86. <span>{{ streamInfo.hls }}</span>
  87. </el-dropdown-item>
  88. <el-dropdown-item :command="streamInfo.https_hls">
  89. <el-tag >HLS(https):</el-tag>
  90. <span>{{ streamInfo.https_hls }}</span>
  91. </el-dropdown-item>
  92. <el-dropdown-item :command="streamInfo.ws_hls">
  93. <el-tag >HLS(ws):</el-tag>
  94. <span>{{ streamInfo.ws_hls }}</span>
  95. </el-dropdown-item>
  96. <el-dropdown-item :command="streamInfo.wss_hls">
  97. <el-tag >HLS(wss):</el-tag>
  98. <span>{{ streamInfo.wss_hls }}</span>
  99. </el-dropdown-item>
  100. <el-dropdown-item :command="streamInfo.ts">
  101. <el-tag>TS:</el-tag>
  102. <span>{{ streamInfo.ts }}</span>
  103. </el-dropdown-item>
  104. <el-dropdown-item :command="streamInfo.https_ts">
  105. <el-tag>TS(https):</el-tag>
  106. <span>{{ streamInfo.https_ts }}</span>
  107. </el-dropdown-item>
  108. <el-dropdown-item :command="streamInfo.ws_ts">
  109. <el-tag>TS(ws):</el-tag>
  110. <span>{{ streamInfo.ws_ts }}</span>
  111. </el-dropdown-item>
  112. <el-dropdown-item :command="streamInfo.wss_ts">
  113. <el-tag>TS(wss):</el-tag>
  114. <span>{{ streamInfo.wss_ts }}</span>
  115. </el-dropdown-item>
  116. <el-dropdown-item :command="streamInfo.rtc">
  117. <el-tag >RTC:</el-tag>
  118. <span>{{ streamInfo.rtc }}</span>
  119. </el-dropdown-item>
  120. <el-dropdown-item :command="streamInfo.rtmp">
  121. <el-tag >RTMP:</el-tag>
  122. <span>{{ streamInfo.rtmp }}</span>
  123. </el-dropdown-item>
  124. <el-dropdown-item :command="streamInfo.rtmps">
  125. <el-tag >RTMPS:</el-tag>
  126. <span>{{ streamInfo.rtmps }}</span>
  127. </el-dropdown-item>
  128. <el-dropdown-item :command="streamInfo.rtsp">
  129. <el-tag >RTSP:</el-tag>
  130. <span>{{ streamInfo.rtsp }}</span>
  131. </el-dropdown-item>
  132. <el-dropdown-item :command="streamInfo.rtsps">
  133. <el-tag >RTSPS:</el-tag>
  134. <span>{{ streamInfo.rtsps }}</span>
  135. </el-dropdown-item>
  136. </el-dropdown-menu>
  137. </el-dropdown>
  138. </el-input>
  139. </div>
  140. </el-tab-pane>
  141. <!--{"code":0,"data":{"paths":["22-29-30.mp4"],"rootPath":"/home/kkkkk/Documents/ZLMediaKit/release/linux/Debug/www/record/hls/kkkkk/2020-05-11/"}}-->
  142. <el-tab-pane label="录像查询" name="record" v-if="showRrecord">
  143. <div style="width: 100%;">
  144. <div style="width: 100%; text-align: left">
  145. <span>录像控制</span>
  146. <el-button-group style="margin-left: 1rem;">
  147. <el-button size="mini" class="iconfont icon-zanting" title="开始" @click="gbPause()"></el-button>
  148. <el-button size="mini" class="iconfont icon-kaishi" title="暂停" @click="gbPlay()"></el-button>
  149. <el-dropdown size="mini" title="播放倍速" style="margin-left: 1px;" @command="gbScale">
  150. <el-button size="mini">
  151. 倍速 <i class="el-icon-arrow-down el-icon--right"></i>
  152. </el-button>
  153. <el-dropdown-menu slot="dropdown">
  154. <el-dropdown-item command="0.25">0.25倍速</el-dropdown-item>
  155. <el-dropdown-item command="0.5">0.5倍速</el-dropdown-item>
  156. <el-dropdown-item command="1.0">1倍速</el-dropdown-item>
  157. <el-dropdown-item command="2.0">2倍速</el-dropdown-item>
  158. <el-dropdown-item command="4.0">4倍速</el-dropdown-item>
  159. </el-dropdown-menu>
  160. </el-dropdown>
  161. </el-button-group>
  162. <el-date-picker style="float: right;" size="mini" v-model="videoHistory.date" type="date" value-format="yyyy-MM-dd" placeholder="日期" @change="queryRecords()"></el-date-picker>
  163. </div>
  164. <div style="width: 100%; text-align: left">
  165. <span class="demonstration" style="padding: 12px 36px 12px 0;float: left;">{{showTimeText}}</span>
  166. <el-slider style="width: 80%; float:left;" v-model="sliderTime" @change="gbSeek" :show-tooltip="false"></el-slider>
  167. </div>
  168. </div>
  169. <el-table :data="videoHistory.searchHistoryResult" height="150" v-loading="recordsLoading">
  170. <el-table-column label="名称" prop="name"></el-table-column>
  171. <el-table-column label="文件" prop="filePath"></el-table-column>
  172. <el-table-column label="开始时间" prop="startTime" :formatter="timeFormatter"></el-table-column>
  173. <el-table-column label="结束时间" prop="endTime" :formatter="timeFormatter"></el-table-column>
  174. <el-table-column label="操作">
  175. <template slot-scope="scope">
  176. <el-button-group>
  177. <el-button icon="el-icon-video-play" size="mini" @click="playRecord(scope.row)">播放</el-button>
  178. <el-button icon="el-icon-download" size="mini" @click="downloadRecord(scope.row)">下载</el-button>
  179. </el-button-group>
  180. </template>
  181. </el-table-column>
  182. </el-table>
  183. </el-tab-pane>
  184. <!--遥控界面-->
  185. <el-tab-pane label="云台控制" name="control" v-if="showPtz">
  186. <div style="display: flex; justify-content: left;">
  187. <div class="control-wrapper">
  188. <div class="control-btn control-top" @mousedown="ptzCamera('up')" @mouseup="ptzCamera('stop')">
  189. <i class="el-icon-caret-top"></i>
  190. <div class="control-inner-btn control-inner"></div>
  191. </div>
  192. <div class="control-btn control-left" @mousedown="ptzCamera('left')" @mouseup="ptzCamera('stop')">
  193. <i class="el-icon-caret-left"></i>
  194. <div class="control-inner-btn control-inner"></div>
  195. </div>
  196. <div class="control-btn control-bottom" @mousedown="ptzCamera('down')" @mouseup="ptzCamera('stop')">
  197. <i class="el-icon-caret-bottom"></i>
  198. <div class="control-inner-btn control-inner"></div>
  199. </div>
  200. <div class="control-btn control-right" @mousedown="ptzCamera('right')" @mouseup="ptzCamera('stop')">
  201. <i class="el-icon-caret-right"></i>
  202. <div class="control-inner-btn control-inner"></div>
  203. </div>
  204. <div class="control-round">
  205. <div class="control-round-inner"><i class="fa fa-pause-circle"></i></div>
  206. </div>
  207. <div style="position: absolute; left: 7.25rem; top: 1.25rem" @mousedown="ptzCamera('zoomin')" @mouseup="ptzCamera('stop')"><i class="el-icon-zoom-in control-zoom-btn" style="font-size: 1.875rem;"></i></div>
  208. <div style="position: absolute; left: 7.25rem; top: 3.25rem; font-size: 1.875rem;" @mousedown="ptzCamera('zoomout')" @mouseup="ptzCamera('stop')"><i class="el-icon-zoom-out control-zoom-btn"></i></div>
  209. <div class="contro-speed" style="position: absolute; left: 4px; top: 7rem; width: 9rem;">
  210. <el-slider v-model="controSpeed" :max="255"></el-slider>
  211. </div>
  212. </div>
  213. <div class="control-panel">
  214. <el-button-group>
  215. <el-tag style="position :absolute; left: 0rem; top: 0rem; width: 5rem; text-align: center" size="medium">预置位编号</el-tag>
  216. <el-input-number style="position: absolute; left: 5rem; top: 0rem; width: 6rem" size="mini" v-model="presetPos" controls-position="right" :precision="0" :step="1" :min="1" :max="255"></el-input-number>
  217. <el-button style="position: absolute; left: 11rem; top: 0rem; width: 5rem" size="mini" icon="el-icon-add-location" @click="presetPosition(129, presetPos)">设置</el-button>
  218. <el-button style="position: absolute; left: 27rem; top: 0rem; width: 5rem" size="mini" type="primary" icon="el-icon-place" @click="presetPosition(130, presetPos)">调用</el-button>
  219. <el-button style="position: absolute; left: 16rem; top: 0rem; width: 5rem" size="mini" icon="el-icon-delete-location" @click="presetPosition(131, presetPos)">删除</el-button>
  220. <el-tag style="position :absolute; left: 0rem; top: 2.5rem; width: 5rem; text-align: center" size="medium">巡航速度</el-tag>
  221. <el-input-number style="position: absolute; left: 5rem; top: 2.5rem; width: 6rem" size="mini" v-model="cruisingSpeed" controls-position="right" :precision="0" :min="1" :max="4095"></el-input-number>
  222. <el-button style="position: absolute; left: 11rem; top: 2.5rem; width: 5rem" size="mini" icon="el-icon-loading" @click="setSpeedOrTime(134, cruisingGroup, cruisingSpeed)">设置</el-button>
  223. <el-tag style="position :absolute; left: 16rem; top: 2.5rem; width: 5rem; text-align: center" size="medium">停留时间</el-tag>
  224. <el-input-number style="position: absolute; left: 21rem; top: 2.5rem; width: 6rem" size="mini" v-model="cruisingTime" controls-position="right" :precision="0" :min="1" :max="4095"></el-input-number>
  225. <el-button style="position: absolute; left: 27rem; top: 2.5rem; width: 5rem" size="mini" icon="el-icon-timer" @click="setSpeedOrTime(135, cruisingGroup, cruisingTime)">设置</el-button>
  226. <el-tag style="position :absolute; left: 0rem; top: 4.5rem; width: 5rem; text-align: center" size="medium">巡航组编号</el-tag>
  227. <el-input-number style="position: absolute; left: 5rem; top: 4.5rem; width: 6rem" size="mini" v-model="cruisingGroup" controls-position="right" :precision="0" :min="0" :max="255"></el-input-number>
  228. <el-button style="position: absolute; left: 11rem; top: 4.5rem; width: 5rem" size="mini" icon="el-icon-add-location" @click="setCommand(132, cruisingGroup, presetPos)">添加点</el-button>
  229. <el-button style="position: absolute; left: 16rem; top: 4.5rem; width: 5rem" size="mini" icon="el-icon-delete-location" @click="setCommand(133, cruisingGroup, presetPos)">删除点</el-button>
  230. <el-button style="position: absolute; left: 21rem; top: 4.5rem; width: 5rem" size="mini" icon="el-icon-delete" @click="setCommand(133, cruisingGroup, 0)">删除组</el-button>
  231. <el-button style="position: absolute; left: 27rem; top: 5rem; width: 5rem" size="mini" type="primary" icon="el-icon-video-camera-solid" @click="setCommand(136, cruisingGroup, 0)">巡航</el-button>
  232. <el-tag style="position :absolute; left: 0rem; top: 7rem; width: 5rem; text-align: center" size="medium">扫描速度</el-tag>
  233. <el-input-number style="position: absolute; left: 5rem; top: 7rem; width: 6rem" size="mini" v-model="scanSpeed" controls-position="right" :precision="0" :min="1" :max="4095"></el-input-number>
  234. <el-button style="position: absolute; left: 11rem; top: 7rem; width: 5rem" size="mini" icon="el-icon-loading" @click="setSpeedOrTime(138, scanGroup, scanSpeed)">设置</el-button>
  235. <el-tag style="position :absolute; left: 0rem; top: 9rem; width: 5rem; text-align: center" size="medium">扫描组编号</el-tag>
  236. <el-input-number style="position: absolute; left: 5rem; top: 9rem; width: 6rem" size="mini" v-model="scanGroup" controls-position="right" :precision="0" :step="1" :min="0" :max="255"></el-input-number>
  237. <el-button style="position: absolute; left: 11rem; top: 9rem; width: 5rem" size="mini" icon="el-icon-d-arrow-left" @click="setCommand(137, scanGroup, 1)">左边界</el-button>
  238. <el-button style="position: absolute; left: 16rem; top: 9rem; width: 5rem" size="mini" icon="el-icon-d-arrow-right" @click="setCommand(137, scanGroup, 2)">右边界</el-button>
  239. <el-button style="position: absolute; left: 27rem; top: 7rem; width: 5rem" size="mini" type="primary" icon="el-icon-video-camera-solid" @click="setCommand(137, scanGroup, 0)">扫描</el-button>
  240. <el-button style="position: absolute; left: 27rem; top: 9rem; width: 5rem" size="mini" type="danger" icon="el-icon-switch-button" @click="ptzCamera('stop')">停止</el-button>
  241. </el-button-group>
  242. </div>
  243. </div>
  244. </el-tab-pane>
  245. <el-tab-pane label="编码信息" name="codec" v-loading="tracksLoading">
  246. <p>
  247. 无法播放或者没有声音?&nbsp&nbsp&nbsp试一试&nbsp
  248. <el-button size="mini" type="primary" v-if="!coverPlaying" @click="coverPlay">转码播放</el-button>
  249. <el-button size="mini" type="danger" v-if="coverPlaying" @click="convertStopClick">停止转码</el-button>
  250. </p>
  251. <div class="trank" >
  252. <p v-if="tracksNotLoaded" style="text-align: center;padding-top: 3rem;">暂无数据</p>
  253. <div v-for="(item, index) in tracks" style="width: 50%; float: left" loading>
  254. <span >流 {{index}}</span>
  255. <div class="trankInfo" v-if="item.codec_type == 0">
  256. <p>格式: {{item.codec_id_name}}</p>
  257. <p>类型: 视频</p>
  258. <p>分辨率: {{item.width}} x {{item.height}}</p>
  259. <p>帧率: {{item.fps}}</p>
  260. </div>
  261. <div class="trankInfo" v-if="item.codec_type == 1">
  262. <p>格式: {{item.codec_id_name}}</p>
  263. <p>类型: 音频</p>
  264. <p>采样位数: {{item.sample_bit}}</p>
  265. <p>采样率: {{item.sample_rate}}</p>
  266. </div>
  267. </div>
  268. </div>
  269. </el-tab-pane>
  270. <el-tab-pane label="语音对讲" name="broadcast" >
  271. <div class="trank" style="text-align: center;">
  272. <el-button @click="broadcastStatusClick()" :type="getBroadcastStatus()" :disabled="broadcastStatus === -2" circle icon="el-icon-microphone" style="font-size: 32px; padding: 24px;margin-top: 24px;"/>
  273. <p>
  274. <span v-if="broadcastStatus === -2">正在释放资源</span>
  275. <span v-if="broadcastStatus === -1">点击开始对讲</span>
  276. <span v-if="broadcastStatus === 0">等待接通中...</span>
  277. <span v-if="broadcastStatus === 1">请说话</span>
  278. </p>
  279. </div>
  280. </el-tab-pane>
  281. </el-tabs>
  282. </div>
  283. </el-dialog>
  284. <recordDownload ref="recordDownload"></recordDownload>
  285. </div>
  286. </template>
  287. <script>
  288. import rtcPlayer from '../dialog/rtcPlayer.vue'
  289. import crypto from 'crypto'
  290. // import LivePlayer from '@liveqing/liveplayer'
  291. // import player from '../dialog/easyPlayer.vue'
  292. import jessibucaPlayer from '../common/jessibuca.vue'
  293. import recordDownload from '../dialog/recordDownload.vue'
  294. export default {
  295. name: 'devicePlayer',
  296. props: {},
  297. components: {
  298. jessibucaPlayer, rtcPlayer, recordDownload,
  299. },
  300. computed: {
  301. getPlayerShared: function () {
  302. return {
  303. sharedUrl: window.location.origin + '/#/play/wasm/' + encodeURIComponent(this.videoUrl),
  304. sharedIframe: '<iframe src="' + window.location.origin + '/#/play/wasm/' + encodeURIComponent(this.videoUrl) + '"></iframe>',
  305. sharedRtmp: this.videoUrl
  306. };
  307. }
  308. },
  309. created() {
  310. console.log("created")
  311. console.log(this.player)
  312. this.broadcastStatus = -1;
  313. if (Object.keys(this.player).length === 1) {
  314. this.activePlayer = Object.keys(this.player)[0]
  315. }
  316. },
  317. data() {
  318. return {
  319. video: 'http://lndxyj.iqilu.com/public/upload/2019/10/14/8c001ea0c09cdc59a57829dabc8010fa.mp4',
  320. videoUrl: '',
  321. activePlayer: "jessibuca",
  322. // 如何你只是用一种播放器,直接注释掉不用的部分即可
  323. player: {
  324. jessibuca : ["ws_flv", "wss_flv"],
  325. webRTC: ["rtc", "rtcs"],
  326. },
  327. videoHistory: {
  328. date: '',
  329. searchHistoryResult: [] //媒体流历史记录搜索结果
  330. },
  331. showVideoDialog: false,
  332. streamId: '',
  333. app : '',
  334. mediaServerId : '',
  335. convertKey: '',
  336. deviceId: '',
  337. channelId: '',
  338. tabActiveName: 'media',
  339. hasAudio: false,
  340. loadingRecords: false,
  341. recordsLoading: false,
  342. isLoging: false,
  343. controSpeed: 30,
  344. timeVal: 0,
  345. timeMin: 0,
  346. timeMax: 1440,
  347. presetPos: 1,
  348. cruisingSpeed: 100,
  349. cruisingTime: 5,
  350. cruisingGroup: 0,
  351. scanSpeed: 100,
  352. scanGroup: 0,
  353. tracks: [],
  354. coverPlaying:false,
  355. tracksLoading: false,
  356. recordPlay: "",
  357. showPtz: true,
  358. showRrecord: true,
  359. tracksNotLoaded: false,
  360. sliderTime: 0,
  361. seekTime: 0,
  362. recordStartTime: 0,
  363. showTimeText: "00:00:00",
  364. streamInfo: null,
  365. broadcastRtc: null,
  366. broadcastStatus: -1, // -2 正在释放资源 -1 默认状态 0 等待接通 1 接通成功
  367. };
  368. },
  369. methods: {
  370. tabHandleClick: function(tab, event) {
  371. console.log(tab)
  372. var that = this;
  373. that.tracks = [];
  374. that.tracksLoading = true;
  375. that.tracksNotLoaded = false;
  376. if (tab.name === "codec") {
  377. this.$axios({
  378. method: 'get',
  379. url: '/zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtsp&app='+ this.app +'&stream='+ this.streamId
  380. }).then(function (res) {
  381. that.tracksLoading = false;
  382. if (res.data.code == 0 && res.data.tracks) {
  383. that.tracks = res.data.tracks;
  384. }else{
  385. that.tracksNotLoaded = true;
  386. that.$message({
  387. showClose: true,
  388. message: '获取编码信息失败,',
  389. type: 'warning'
  390. });
  391. }
  392. }).catch(function (e) {});
  393. }
  394. },
  395. changePlayer: function (tab) {
  396. console.log(this.player[tab.name][0])
  397. this.activePlayer = tab.name;
  398. this.videoUrl = this.streamInfo[this.player[tab.name][0]]
  399. console.log(this.videoUrl)
  400. },
  401. openDialog: function (tab, deviceId, channelId, param) {
  402. this.tabActiveName = tab;
  403. this.channelId = channelId;
  404. this.deviceId = deviceId;
  405. this.streamId = "";
  406. this.mediaServerId = "";
  407. this.app = "";
  408. this.videoUrl = ""
  409. if (!!this.$refs[this.activePlayer]) {
  410. this.$refs[this.activePlayer].pause();
  411. }
  412. switch (tab) {
  413. case "media":
  414. this.play(param.streamInfo, param.hasAudio)
  415. break;
  416. case "record":
  417. this.showVideoDialog = true;
  418. this.videoHistory.date = param.date;
  419. this.queryRecords()
  420. break;
  421. case "streamPlay":
  422. this.tabActiveName = "media";
  423. this.showRrecord = false;
  424. this.showPtz = false;
  425. this.play(param.streamInfo, param.hasAudio)
  426. break;
  427. case "control":
  428. break;
  429. }
  430. },
  431. timeAxisSelTime: function (val) {
  432. console.log(val)
  433. },
  434. play: function (streamInfo, hasAudio) {
  435. this.streamInfo = streamInfo;
  436. this.hasAudio = hasAudio;
  437. this.isLoging = false;
  438. // this.videoUrl = streamInfo.rtc;
  439. this.videoUrl = this.getUrlByStreamInfo();
  440. this.streamId = streamInfo.stream;
  441. this.app = streamInfo.app;
  442. this.mediaServerId = streamInfo.mediaServerId;
  443. this.playFromStreamInfo(false, streamInfo)
  444. },
  445. getUrlByStreamInfo(){
  446. console.log(this.streamInfo)
  447. if (location.protocol === "https:") {
  448. this.videoUrl = this.streamInfo[this.player[this.activePlayer][1]]
  449. }else {
  450. this.videoUrl = this.streamInfo[this.player[this.activePlayer][0]]
  451. }
  452. return this.videoUrl;
  453. },
  454. coverPlay: function () {
  455. var that = this;
  456. this.coverPlaying = true;
  457. this.$refs[this.activePlayer].pause()
  458. that.$axios({
  459. method: 'post',
  460. url: '/api/play/convert/' + that.streamId
  461. }).then(function (res) {
  462. if (res.data.code === 0) {
  463. that.convertKey = res.data.key;
  464. setTimeout(()=>{
  465. that.isLoging = false;
  466. that.playFromStreamInfo(false, res.data.data);
  467. }, 2000)
  468. } else {
  469. that.isLoging = false;
  470. that.coverPlaying = false;
  471. that.$message({
  472. showClose: true,
  473. message: '转码失败',
  474. type: 'error'
  475. });
  476. }
  477. }).catch(function (e) {
  478. console.log(e)
  479. that.coverPlaying = false;
  480. that.$message({
  481. showClose: true,
  482. message: '播放错误',
  483. type: 'error'
  484. });
  485. });
  486. },
  487. convertStopClick: function() {
  488. this.convertStop(()=>{
  489. this.$refs[this.activePlayer].play(this.videoUrl)
  490. });
  491. },
  492. convertStop: function(callback) {
  493. var that = this;
  494. that.$refs.videoPlayer.pause()
  495. this.$axios({
  496. method: 'post',
  497. url: '/api/play/convertStop/' + this.convertKey
  498. }).then(function (res) {
  499. if (res.data.code == 0) {
  500. console.log(res.data.msg)
  501. }else {
  502. console.error(res.data.msg)
  503. }
  504. if (callback )callback();
  505. }).catch(function (e) {});
  506. that.coverPlaying = false;
  507. that.convertKey = "";
  508. // if (callback )callback();
  509. },
  510. playFromStreamInfo: function (realHasAudio, streamInfo) {
  511. this.showVideoDialog = true;
  512. this.hasaudio = realHasAudio && this.hasaudio;
  513. this.$refs[this.activePlayer].play(this.getUrlByStreamInfo(streamInfo))
  514. },
  515. close: function () {
  516. console.log('关闭视频');
  517. if (!!this.$refs[this.activePlayer]){
  518. this.$refs[this.activePlayer].pause();
  519. }
  520. this.videoUrl = '';
  521. this.coverPlaying = false;
  522. this.showVideoDialog = false;
  523. if (this.convertKey != '') {
  524. this.convertStop();
  525. }
  526. this.convertKey = ''
  527. if (this.recordPlay != '') {
  528. this.stopPlayRecord();
  529. }
  530. this.recordPlay = ''
  531. this.stopBroadcast()
  532. },
  533. copySharedInfo: function (data) {
  534. console.log('复制内容:' + data);
  535. this.coverPlaying = false;
  536. this.tracks = []
  537. let _this = this;
  538. this.$copyText(data).then(
  539. function (e) {
  540. _this.$message({
  541. showClose: true,
  542. message: '复制成功',
  543. type: 'success'
  544. });
  545. },
  546. function (e) {
  547. _this.$message({
  548. showClose: true,
  549. message: '复制失败,请手动复制',
  550. type: 'error'
  551. });
  552. }
  553. );
  554. },
  555. queryRecords: function () {
  556. if (!this.videoHistory.date) {
  557. return;
  558. }
  559. this.recordsLoading = true;
  560. this.videoHistory.searchHistoryResult = [];
  561. let that = this;
  562. var startTime = this.videoHistory.date + " 00:00:00";
  563. var endTime = this.videoHistory.date + " 23:59:59";
  564. this.$axios({
  565. method: 'get',
  566. url: '/api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + startTime + '&endTime=' + endTime
  567. }).then(function (res) {
  568. console.log(res)
  569. that.recordsLoading = false;
  570. if(res.data.code === 0) {
  571. // 处理时间信息
  572. that.videoHistory.searchHistoryResult = res.data.data.recordList;
  573. }else {
  574. this.$message({
  575. showClose: true,
  576. message: res.data.msg,
  577. type: "error",
  578. });
  579. }
  580. }).catch(function (e) {
  581. console.log(e.message);
  582. // that.videoHistory.searchHistoryResult = falsificationData.recordData;
  583. });
  584. },
  585. onTimeChange: function (video) {
  586. // this.queryRecords()
  587. },
  588. playRecord: function (row) {
  589. let that = this;
  590. let startTime = row.startTime
  591. this.recordStartTime = row.startTime
  592. this.showTimeText = row.startTime.split(" ")[1]
  593. let endtime = row.endTime
  594. this.sliderTime = 0;
  595. this.seekTime = new Date(endtime).getTime() - new Date(startTime).getTime();
  596. console.log(this.seekTime)
  597. if (that.streamId != "") {
  598. that.stopPlayRecord(function () {
  599. that.streamId = "";
  600. that.playRecord(row);
  601. })
  602. } else {
  603. this.$axios({
  604. method: 'get',
  605. url: '/api/playback/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' +
  606. row.endTime
  607. }).then(function (res) {
  608. if (res.data.code === 0) {
  609. that.streamInfo = res.data.data;
  610. that.app = that.streamInfo.app;
  611. that.streamId = that.streamInfo.stream;
  612. that.mediaServerId = that.streamInfo.mediaServerId;
  613. that.ssrc = that.streamInfo.ssrc;
  614. that.videoUrl = that.getUrlByStreamInfo();
  615. }else {
  616. that.$message({
  617. showClose: true,
  618. message: res.data.msg,
  619. type: "error",
  620. });
  621. }
  622. that.recordPlay = true;
  623. });
  624. }
  625. },
  626. stopPlayRecord: function (callback) {
  627. this.$refs[this.activePlayer].pause();
  628. this.videoUrl = '';
  629. this.$axios({
  630. method: 'get',
  631. url: '/api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId
  632. }).then(function (res) {
  633. if (callback) callback()
  634. });
  635. },
  636. downloadRecord: function (row) {
  637. let that = this;
  638. if (that.streamId != "") {
  639. that.stopDownloadRecord(function (res) {
  640. if (res.code == 0) {
  641. that.streamId = "";
  642. that.downloadRecord(row);
  643. }else {
  644. this.$message({
  645. showClose: true,
  646. message: res.data.msg,
  647. type: "error",
  648. });
  649. }
  650. })
  651. } else {
  652. this.$axios({
  653. method: 'get',
  654. url: '/api/gb_record/download/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' +
  655. row.endTime + '&downloadSpeed=4'
  656. }).then(function (res) {
  657. if (res.data.code == 0) {
  658. let streamInfo = res.data.data;
  659. that.recordPlay = false;
  660. that.$refs.recordDownload.openDialog(that.deviceId, that.channelId, streamInfo.app, streamInfo.stream, streamInfo.mediaServerId);
  661. }else {
  662. that.$message({
  663. showClose: true,
  664. message: res.data.msg,
  665. type: "error",
  666. });
  667. }
  668. });
  669. }
  670. },
  671. stopDownloadRecord: function (callback) {
  672. this.$refs[this.activePlayer].pause();
  673. this.videoUrl = '';
  674. this.$axios({
  675. method: 'get',
  676. url: '/api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId
  677. }).then((res)=> {
  678. if (callback) callback(res)
  679. });
  680. },
  681. ptzCamera: function (command) {
  682. console.log('云台控制:' + command);
  683. let that = this;
  684. this.$axios({
  685. method: 'post',
  686. url: '/api/ptz/control/' + this.deviceId + '/' + this.channelId + '?command=' + command + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed
  687. }).then(function (res) {});
  688. },
  689. //////////////////////播放器事件处理//////////////////////////
  690. videoError: function (e) {
  691. console.log("播放器错误:" + JSON.stringify(e));
  692. },
  693. presetPosition: function (cmdCode, presetPos) {
  694. console.log('预置位控制:' + this.presetPos + ' : 0x' + cmdCode.toString(16));
  695. let that = this;
  696. this.$axios({
  697. method: 'post',
  698. url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=0&parameter2=' + presetPos + '&combindCode2=0'
  699. }).then(function (res) {});
  700. },
  701. setSpeedOrTime: function (cmdCode, groupNum, parameter) {
  702. let that = this;
  703. let parameter2 = parameter % 256;
  704. let combindCode2 = Math.floor(parameter / 256) * 16;
  705. console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16));
  706. this.$axios({
  707. method: 'post',
  708. url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter2 + '&combindCode2=' + combindCode2
  709. }).then(function (res) {});
  710. },
  711. setCommand: function (cmdCode, groupNum, parameter) {
  712. let that = this;
  713. console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0');
  714. this.$axios({
  715. method: 'post',
  716. url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter + '&combindCode2=0'
  717. }).then(function (res) {});
  718. },
  719. formatTooltip: function (val) {
  720. var h = parseInt(val / 60);
  721. var hStr = h < 10 ? ("0" + h) : h;
  722. var s = val % 60;
  723. var sStr = s < 10 ? ("0" + s) : s;
  724. return h + ":" + sStr;
  725. },
  726. timeFormatter: function (row, column, cellValue, index) {
  727. return cellValue.split(" ")[1];
  728. },
  729. mergeTime: function (timeArray) {
  730. var resultArray = [];
  731. for (let i = 0; i < timeArray.length; i++) {
  732. var startTime = new Date(timeArray[i].startTime);
  733. var endTime = new Date(timeArray[i].endTime);
  734. if (i == 0) {
  735. resultArray[0] = {
  736. startTime: startTime,
  737. endTime: endTime
  738. }
  739. }
  740. for (let j = 0; j < resultArray.length; j++) {
  741. if (startTime > resultArray[j].endTime) { // 合并
  742. if (startTime - resultArray[j].endTime <= 1000) {
  743. resultArray[j].endTime = endTime;
  744. } else {
  745. resultArray[resultArray.length] = {
  746. startTime: startTime,
  747. endTime: endTime
  748. }
  749. }
  750. } else if (resultArray[j].startTime > endTime) { // 合并
  751. if (resultArray[j].startTime - endTime <= 1000) {
  752. resultArray[j].startTime = startTime;
  753. } else {
  754. resultArray[resultArray.length] = {
  755. startTime: startTime,
  756. endTime: endTime
  757. }
  758. }
  759. }
  760. }
  761. }
  762. console.log(resultArray)
  763. return resultArray;
  764. },
  765. copyUrl: function (dropdownItem){
  766. console.log(dropdownItem)
  767. this.$copyText(dropdownItem).then((e)=> {
  768. this.$message.success("成功拷贝到粘贴板");
  769. }, (e)=> {
  770. })
  771. },
  772. gbPlay(){
  773. console.log('前端控制:播放');
  774. this.$axios({
  775. method: 'get',
  776. url: '/api/playback/resume/' + this.streamId
  777. }).then((res)=> {
  778. this.$refs[this.activePlayer].play(this.videoUrl)
  779. });
  780. },
  781. gbPause(){
  782. console.log('前端控制:暂停');
  783. this.$axios({
  784. method: 'get',
  785. url: '/api/playback/pause/' + this.streamId
  786. }).then(function (res) {});
  787. },
  788. gbScale(command){
  789. console.log('前端控制:倍速 ' + command);
  790. this.$axios({
  791. method: 'get',
  792. url: `/api/playback/speed/${this.streamId }/${command}`
  793. }).then(function (res) {});
  794. },
  795. gbSeek(val){
  796. console.log('前端控制:seek ');
  797. console.log(this.seekTime);
  798. console.log(this.sliderTime);
  799. let showTime = new Date(new Date(this.recordStartTime).getTime() + this.seekTime * val / 100)
  800. let hour = showTime.getHours();
  801. let minutes = showTime.getMinutes();
  802. let seconds = showTime.getSeconds();
  803. this.showTimeText = (hour < 10?("0" + hour):hour) + ":" + (minutes<10?("0" + minutes):minutes) + ":" + (seconds<10?("0" + seconds):seconds)
  804. this.$axios({
  805. method: 'get',
  806. url: `/api/playback/seek/${this.streamId }/` + Math.floor(this.seekTime * val / 100000)
  807. }).then( (res)=> {
  808. setTimeout(()=>{
  809. this.$refs[this.activePlayer].play(this.videoUrl)
  810. }, 600)
  811. });
  812. },
  813. getBroadcastStatus() {
  814. if (this.broadcastStatus == -2) {
  815. return "primary"
  816. }
  817. if (this.broadcastStatus == -1) {
  818. return "primary"
  819. }
  820. if (this.broadcastStatus == 0) {
  821. return "warning"
  822. }
  823. if (this.broadcastStatus == 1) {
  824. return "danger"
  825. }
  826. },
  827. broadcastStatusClick() {
  828. if (this.broadcastStatus == -1) {
  829. // 默认状态, 开始
  830. this.broadcastStatus = 0
  831. // 发起语音对讲
  832. this.$axios({
  833. method: 'get',
  834. url: '/api/play/broadcast/' + this.deviceId + '/' + this.channelId + "?timeout=30"
  835. }).then( (res)=> {
  836. if (res.data.code == 0) {
  837. let streamInfo = res.data.data.streamInfo;
  838. if (document.location.protocol.includes("https")) {
  839. this.startBroadcast(streamInfo.rtcs)
  840. }else {
  841. this.startBroadcast(streamInfo.rtc)
  842. }
  843. }else {
  844. this.$message({
  845. showClose: true,
  846. message: res.data.msg,
  847. type: "error",
  848. });
  849. }
  850. });
  851. }else if (this.broadcastStatus === 1) {
  852. this.stopBroadcast()
  853. }
  854. },
  855. startBroadcast(url){
  856. // 获取推流鉴权Key
  857. this.$axios({
  858. method: 'post',
  859. url: '/api/user/userInfo',
  860. }).then( (res)=> {
  861. if (res.data.code !== 0) {
  862. this.$message({
  863. showClose: true,
  864. message: "获取推流鉴权Key失败",
  865. type: "error",
  866. });
  867. }else {
  868. let pushKey = res.data.data.pushKey;
  869. // 获取推流鉴权KEY
  870. url += "&sign=" + crypto.createHash('md5').update(pushKey, "utf8").digest('hex')
  871. console.log("开始语音对讲: " + url)
  872. this.broadcastRtc = new ZLMRTCClient.Endpoint({
  873. debug: true, // 是否打印日志
  874. zlmsdpUrl: url, //流地址
  875. simulecast: false,
  876. useCamera: false,
  877. audioEnable: true,
  878. videoEnable: false,
  879. recvOnly: false,
  880. })
  881. // webrtcPlayer.on(ZLMRTCClient.Events.WEBRTC_ON_REMOTE_STREAMS,(e)=>{//获取到了远端流,可以播放
  882. // console.error('播放成功',e.streams)
  883. // this.broadcastStatus = 1;
  884. // });
  885. //
  886. // webrtcPlayer.on(ZLMRTCClient.Events.WEBRTC_ON_LOCAL_STREAM,(s)=>{// 获取到了本地流
  887. // this.broadcastStatus = 1;
  888. // // document.getElementById('selfVideo').srcObject=s;
  889. // // this.eventcallbacK("LOCAL STREAM", "获取到了本地流")
  890. // });
  891. this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_NOT_SUPPORT,(e)=>{// 获取到了本地流
  892. console.error('不支持webrtc',e)
  893. this.$message({
  894. showClose: true,
  895. message: '不支持webrtc, 无法进行语音对讲',
  896. type: 'error'
  897. });
  898. });
  899. this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_ICE_CANDIDATE_ERROR,(e)=>{// ICE 协商出错
  900. console.error('ICE 协商出错')
  901. this.$message({
  902. showClose: true,
  903. message: 'ICE 协商出错',
  904. type: 'error'
  905. });
  906. });
  907. this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED,(e)=>{// offer anwser 交换失败
  908. console.error('offer anwser 交换失败',e)
  909. this.$message({
  910. showClose: true,
  911. message: 'offer anwser 交换失败' + e,
  912. type: 'error'
  913. });
  914. });
  915. this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_ON_CONNECTION_STATE_CHANGE,(e)=>{// offer anwser 交换失败
  916. console.log('状态改变',e)
  917. if (e === "connecting") {
  918. this.broadcastStatus = 0;
  919. }else if (e === "connected") {
  920. this.broadcastStatus = 1;
  921. }else if (e === "disconnected") {
  922. this.broadcastStatus = -1;
  923. }
  924. });
  925. this.broadcastRtc.on(ZLMRTCClient.Events.CAPTURE_STREAM_FAILED,(e)=>{// offer anwser 交换失败
  926. console.log('捕获流失败',e)
  927. this.$message({
  928. showClose: true,
  929. message: '捕获流失败' + e,
  930. type: 'error'
  931. });
  932. });
  933. }
  934. });
  935. },
  936. stopBroadcast(){
  937. if (this.broadcastStatus === -1) {
  938. this.broadcastStatus = 1;
  939. }else {
  940. this.broadcastStatus = -2;
  941. this.broadcastRtc = null;
  942. this.$axios({
  943. method: 'get',
  944. url: '/api/play/broadcast/stop/' + this.deviceId + '/' + this.channelId
  945. }).then( (res)=> {
  946. if (res.data.code == 0) {
  947. // this.broadcastStatus = -1;
  948. // this.broadcastRtc.close()
  949. }else {
  950. this.$message({
  951. showClose: true,
  952. message: res.data.msg,
  953. type: "error",
  954. });
  955. }
  956. });
  957. }
  958. }
  959. }
  960. };
  961. </script>
  962. <style>
  963. .control-wrapper {
  964. position: relative;
  965. width: 6.25rem;
  966. height: 6.25rem;
  967. max-width: 6.25rem;
  968. max-height: 6.25rem;
  969. border-radius: 100%;
  970. margin-top: 1.5rem;
  971. margin-left: 0.5rem;
  972. float: left;
  973. }
  974. .control-panel {
  975. position: relative;
  976. top: 0;
  977. left: 5rem;
  978. height: 11rem;
  979. max-height: 11rem;
  980. }
  981. .control-btn {
  982. display: flex;
  983. justify-content: center;
  984. position: absolute;
  985. width: 44%;
  986. height: 44%;
  987. border-radius: 5px;
  988. border: 1px solid #78aee4;
  989. box-sizing: border-box;
  990. transition: all 0.3s linear;
  991. }
  992. .control-btn:hover {
  993. cursor:pointer
  994. }
  995. .control-btn i {
  996. font-size: 20px;
  997. color: #78aee4;
  998. display: flex;
  999. justify-content: center;
  1000. align-items: center;
  1001. }
  1002. .control-btn i:hover {
  1003. cursor:pointer
  1004. }
  1005. .control-zoom-btn:hover {
  1006. cursor:pointer
  1007. }
  1008. .control-round {
  1009. position: absolute;
  1010. top: 21%;
  1011. left: 21%;
  1012. width: 58%;
  1013. height: 58%;
  1014. background: #fff;
  1015. border-radius: 100%;
  1016. }
  1017. .control-round-inner {
  1018. position: absolute;
  1019. left: 13%;
  1020. top: 13%;
  1021. display: flex;
  1022. justify-content: center;
  1023. align-items: center;
  1024. width: 70%;
  1025. height: 70%;
  1026. font-size: 40px;
  1027. color: #78aee4;
  1028. border: 1px solid #78aee4;
  1029. border-radius: 100%;
  1030. transition: all 0.3s linear;
  1031. }
  1032. .control-inner-btn {
  1033. position: absolute;
  1034. width: 60%;
  1035. height: 60%;
  1036. background: #fafafa;
  1037. }
  1038. .control-top {
  1039. top: -8%;
  1040. left: 27%;
  1041. transform: rotate(-45deg);
  1042. border-radius: 5px 100% 5px 0;
  1043. }
  1044. .control-top i {
  1045. transform: rotate(45deg);
  1046. border-radius: 5px 100% 5px 0;
  1047. }
  1048. .control-top .control-inner {
  1049. left: -1px;
  1050. bottom: 0;
  1051. border-top: 1px solid #78aee4;
  1052. border-right: 1px solid #78aee4;
  1053. border-radius: 0 100% 0 0;
  1054. }
  1055. .control-top .fa {
  1056. transform: rotate(45deg) translateY(-7px);
  1057. }
  1058. .control-left {
  1059. top: 27%;
  1060. left: -8%;
  1061. transform: rotate(45deg);
  1062. border-radius: 5px 0 5px 100%;
  1063. }
  1064. .control-left i {
  1065. transform: rotate(-45deg);
  1066. }
  1067. .control-left .control-inner {
  1068. right: -1px;
  1069. top: -1px;
  1070. border-bottom: 1px solid #78aee4;
  1071. border-left: 1px solid #78aee4;
  1072. border-radius: 0 0 0 100%;
  1073. }
  1074. .control-left .fa {
  1075. transform: rotate(-45deg) translateX(-7px);
  1076. }
  1077. .control-right {
  1078. top: 27%;
  1079. right: -8%;
  1080. transform: rotate(45deg);
  1081. border-radius: 5px 100% 5px 0;
  1082. }
  1083. .control-right i {
  1084. transform: rotate(-45deg);
  1085. }
  1086. .control-right .control-inner {
  1087. left: -1px;
  1088. bottom: -1px;
  1089. border-top: 1px solid #78aee4;
  1090. border-right: 1px solid #78aee4;
  1091. border-radius: 0 100% 0 0;
  1092. }
  1093. .control-right .fa {
  1094. transform: rotate(-45deg) translateX(7px);
  1095. }
  1096. .control-bottom {
  1097. left: 27%;
  1098. bottom: -8%;
  1099. transform: rotate(45deg);
  1100. border-radius: 0 5px 100% 5px;
  1101. }
  1102. .control-bottom i {
  1103. transform: rotate(-45deg);
  1104. }
  1105. .control-bottom .control-inner {
  1106. top: -1px;
  1107. left: -1px;
  1108. border-bottom: 1px solid #78aee4;
  1109. border-right: 1px solid #78aee4;
  1110. border-radius: 0 0 100% 0;
  1111. }
  1112. .control-bottom .fa {
  1113. transform: rotate(-45deg) translateY(7px);
  1114. }
  1115. .trank {
  1116. width: 80%;
  1117. height: 180px;
  1118. text-align: left;
  1119. padding: 0 10%;
  1120. overflow: auto;
  1121. }
  1122. .trankInfo {
  1123. width: 80%;
  1124. padding: 0 10%;
  1125. }
  1126. </style>