devicePlayer.vue 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155
  1. <template>
  2. <div id="devicePlayer" v-loading="isLoging">
  3. <el-dialog title="视频播放" top="0" :close-on-click-modal="false" :visible.sync="showVideoDialog" @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(this.player)
  311. if (Object.keys(this.player).length === 1) {
  312. this.activePlayer = Object.keys(this.player)[0]
  313. }
  314. },
  315. data() {
  316. return {
  317. video: 'http://lndxyj.iqilu.com/public/upload/2019/10/14/8c001ea0c09cdc59a57829dabc8010fa.mp4',
  318. videoUrl: '',
  319. activePlayer: "jessibuca",
  320. // 如何你只是用一种播放器,直接注释掉不用的部分即可
  321. player: {
  322. jessibuca : ["ws_flv", "wss_flv"],
  323. webRTC: ["rtc", "rtc"],
  324. },
  325. videoHistory: {
  326. date: '',
  327. searchHistoryResult: [] //媒体流历史记录搜索结果
  328. },
  329. showVideoDialog: false,
  330. streamId: '',
  331. app : '',
  332. mediaServerId : '',
  333. convertKey: '',
  334. deviceId: '',
  335. channelId: '',
  336. tabActiveName: 'media',
  337. hasAudio: false,
  338. loadingRecords: false,
  339. recordsLoading: false,
  340. isLoging: false,
  341. controSpeed: 30,
  342. timeVal: 0,
  343. timeMin: 0,
  344. timeMax: 1440,
  345. presetPos: 1,
  346. cruisingSpeed: 100,
  347. cruisingTime: 5,
  348. cruisingGroup: 0,
  349. scanSpeed: 100,
  350. scanGroup: 0,
  351. tracks: [],
  352. coverPlaying:false,
  353. tracksLoading: false,
  354. recordPlay: "",
  355. showPtz: true,
  356. showRrecord: true,
  357. tracksNotLoaded: false,
  358. sliderTime: 0,
  359. seekTime: 0,
  360. recordStartTime: 0,
  361. showTimeText: "00:00:00",
  362. streamInfo: null,
  363. broadcastRtc: null,
  364. broadcastStatus: -1, // -2 正在释放资源 -1 默认状态 0 等待接通 1 接通成功
  365. };
  366. },
  367. methods: {
  368. tabHandleClick: function(tab, event) {
  369. console.log(tab)
  370. var that = this;
  371. that.tracks = [];
  372. that.tracksLoading = true;
  373. that.tracksNotLoaded = false;
  374. if (tab.name === "codec") {
  375. this.$axios({
  376. method: 'get',
  377. url: '/zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtmp&app='+ this.app +'&stream='+ this.streamId
  378. }).then(function (res) {
  379. that.tracksLoading = false;
  380. if (res.data.code == 0 && res.data.tracks) {
  381. that.tracks = res.data.tracks;
  382. }else{
  383. that.tracksNotLoaded = true;
  384. that.$message({
  385. showClose: true,
  386. message: '获取编码信息失败,',
  387. type: 'warning'
  388. });
  389. }
  390. }).catch(function (e) {});
  391. }
  392. },
  393. changePlayer: function (tab) {
  394. console.log(this.player[tab.name][0])
  395. this.activePlayer = tab.name;
  396. this.videoUrl = this.streamInfo[this.player[tab.name][0]]
  397. console.log(this.videoUrl)
  398. },
  399. openDialog: function (tab, deviceId, channelId, param) {
  400. this.tabActiveName = tab;
  401. this.channelId = channelId;
  402. this.deviceId = deviceId;
  403. this.streamId = "";
  404. this.mediaServerId = "";
  405. this.app = "";
  406. this.videoUrl = ""
  407. if (!!this.$refs[this.activePlayer]) {
  408. this.$refs[this.activePlayer].pause();
  409. }
  410. switch (tab) {
  411. case "media":
  412. this.play(param.streamInfo, param.hasAudio)
  413. break;
  414. case "record":
  415. this.showVideoDialog = true;
  416. this.videoHistory.date = param.date;
  417. this.queryRecords()
  418. break;
  419. case "streamPlay":
  420. this.tabActiveName = "media";
  421. this.showRrecord = false;
  422. this.showPtz = false;
  423. this.play(param.streamInfo, param.hasAudio)
  424. break;
  425. case "control":
  426. break;
  427. }
  428. },
  429. timeAxisSelTime: function (val) {
  430. console.log(val)
  431. },
  432. play: function (streamInfo, hasAudio) {
  433. this.streamInfo = streamInfo;
  434. this.hasAudio = hasAudio;
  435. this.isLoging = false;
  436. // this.videoUrl = streamInfo.rtc;
  437. this.videoUrl = this.getUrlByStreamInfo();
  438. this.streamId = streamInfo.stream;
  439. this.app = streamInfo.app;
  440. this.mediaServerId = streamInfo.mediaServerId;
  441. this.playFromStreamInfo(false, streamInfo)
  442. },
  443. getUrlByStreamInfo(){
  444. console.log(this.streamInfo)
  445. if (location.protocol === "https:") {
  446. this.videoUrl = this.streamInfo[this.player[this.activePlayer][1]]
  447. }else {
  448. this.videoUrl = this.streamInfo[this.player[this.activePlayer][0]]
  449. }
  450. return this.videoUrl;
  451. },
  452. coverPlay: function () {
  453. var that = this;
  454. this.coverPlaying = true;
  455. this.$refs[this.activePlayer].pause()
  456. that.$axios({
  457. method: 'post',
  458. url: '/api/play/convert/' + that.streamId
  459. }).then(function (res) {
  460. if (res.data.code === 0) {
  461. that.convertKey = res.data.key;
  462. setTimeout(()=>{
  463. that.isLoging = false;
  464. that.playFromStreamInfo(false, res.data.data);
  465. }, 2000)
  466. } else {
  467. that.isLoging = false;
  468. that.coverPlaying = false;
  469. that.$message({
  470. showClose: true,
  471. message: '转码失败',
  472. type: 'error'
  473. });
  474. }
  475. }).catch(function (e) {
  476. console.log(e)
  477. that.coverPlaying = false;
  478. that.$message({
  479. showClose: true,
  480. message: '播放错误',
  481. type: 'error'
  482. });
  483. });
  484. },
  485. convertStopClick: function() {
  486. this.convertStop(()=>{
  487. this.$refs[this.activePlayer].play(this.videoUrl)
  488. });
  489. },
  490. convertStop: function(callback) {
  491. var that = this;
  492. that.$refs.videoPlayer.pause()
  493. this.$axios({
  494. method: 'post',
  495. url: '/api/play/convertStop/' + this.convertKey
  496. }).then(function (res) {
  497. if (res.data.code == 0) {
  498. console.log(res.data.msg)
  499. }else {
  500. console.error(res.data.msg)
  501. }
  502. if (callback )callback();
  503. }).catch(function (e) {});
  504. that.coverPlaying = false;
  505. that.convertKey = "";
  506. // if (callback )callback();
  507. },
  508. playFromStreamInfo: function (realHasAudio, streamInfo) {
  509. this.showVideoDialog = true;
  510. this.hasaudio = realHasAudio && this.hasaudio;
  511. this.$refs[this.activePlayer].play(this.getUrlByStreamInfo(streamInfo))
  512. },
  513. close: function () {
  514. console.log('关闭视频');
  515. if (!!this.$refs[this.activePlayer]){
  516. this.$refs[this.activePlayer].pause();
  517. }
  518. this.videoUrl = '';
  519. this.coverPlaying = false;
  520. this.showVideoDialog = false;
  521. if (this.convertKey != '') {
  522. this.convertStop();
  523. }
  524. this.convertKey = ''
  525. if (this.recordPlay != '') {
  526. this.stopPlayRecord();
  527. }
  528. this.recordPlay = ''
  529. if (this.broadcastStatus === 1) {
  530. this.stopBroadcast()
  531. }
  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. this.startBroadcast(streamInfo.rtc)
  839. }else {
  840. this.$message({
  841. showClose: true,
  842. message: res.data.msg,
  843. type: "error",
  844. });
  845. }
  846. });
  847. }else if (this.broadcastStatus === 1) {
  848. this.stopBroadcast()
  849. }
  850. },
  851. startBroadcast(url){
  852. // 获取推流鉴权KEY
  853. console.log(this.$loginUser)
  854. console.log(this.$loginUser.pushKey)
  855. url += "&sign=" + crypto.createHash('md5').update(this.$loginUser.pushKey, "utf8").digest('hex')
  856. console.log("开始语音对讲: " + url)
  857. this.broadcastRtc = new ZLMRTCClient.Endpoint({
  858. debug: true, // 是否打印日志
  859. zlmsdpUrl: url, //流地址
  860. simulecast: false,
  861. useCamera: false,
  862. audioEnable: true,
  863. videoEnable: false,
  864. recvOnly: false,
  865. })
  866. // webrtcPlayer.on(ZLMRTCClient.Events.WEBRTC_ON_REMOTE_STREAMS,(e)=>{//获取到了远端流,可以播放
  867. // console.error('播放成功',e.streams)
  868. // this.broadcastStatus = 1;
  869. // });
  870. //
  871. // webrtcPlayer.on(ZLMRTCClient.Events.WEBRTC_ON_LOCAL_STREAM,(s)=>{// 获取到了本地流
  872. // this.broadcastStatus = 1;
  873. // // document.getElementById('selfVideo').srcObject=s;
  874. // // this.eventcallbacK("LOCAL STREAM", "获取到了本地流")
  875. // });
  876. this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_NOT_SUPPORT,(e)=>{// 获取到了本地流
  877. console.error('不支持webrtc',e)
  878. this.$message({
  879. showClose: true,
  880. message: '不支持webrtc, 无法进行语音对讲',
  881. type: 'error'
  882. });
  883. });
  884. this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_ICE_CANDIDATE_ERROR,(e)=>{// ICE 协商出错
  885. console.error('ICE 协商出错')
  886. this.$message({
  887. showClose: true,
  888. message: 'ICE 协商出错',
  889. type: 'error'
  890. });
  891. });
  892. this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED,(e)=>{// offer anwser 交换失败
  893. console.error('offer anwser 交换失败',e)
  894. this.$message({
  895. showClose: true,
  896. message: 'offer anwser 交换失败' + e,
  897. type: 'error'
  898. });
  899. });
  900. this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_ON_CONNECTION_STATE_CHANGE,(e)=>{// offer anwser 交换失败
  901. console.log('状态改变',e)
  902. if (e === "connecting") {
  903. this.broadcastStatus = 0;
  904. }else if (e === "connected") {
  905. this.broadcastStatus = 1;
  906. }else if (e === "disconnected") {
  907. this.broadcastStatus = -1;
  908. }
  909. });
  910. this.broadcastRtc.on(ZLMRTCClient.Events.CAPTURE_STREAM_FAILED,(e)=>{// offer anwser 交换失败
  911. console.log('捕获流失败',e)
  912. this.$message({
  913. showClose: true,
  914. message: '捕获流失败' + e,
  915. type: 'error'
  916. });
  917. });
  918. },
  919. stopBroadcast(){
  920. this.broadcastStatus = -2;
  921. this.broadcastRtc = null;
  922. this.$axios({
  923. method: 'get',
  924. url: '/api/play/broadcast/stop/' + this.deviceId + '/' + this.channelId
  925. }).then( (res)=> {
  926. if (res.data.code == 0) {
  927. // this.broadcastStatus = -1;
  928. // this.broadcastRtc.close()
  929. }else {
  930. this.$message({
  931. showClose: true,
  932. message: res.data.msg,
  933. type: "error",
  934. });
  935. }
  936. });
  937. }
  938. }
  939. };
  940. </script>
  941. <style>
  942. .control-wrapper {
  943. position: relative;
  944. width: 6.25rem;
  945. height: 6.25rem;
  946. max-width: 6.25rem;
  947. max-height: 6.25rem;
  948. border-radius: 100%;
  949. margin-top: 1.5rem;
  950. margin-left: 0.5rem;
  951. float: left;
  952. }
  953. .control-panel {
  954. position: relative;
  955. top: 0;
  956. left: 5rem;
  957. height: 11rem;
  958. max-height: 11rem;
  959. }
  960. .control-btn {
  961. display: flex;
  962. justify-content: center;
  963. position: absolute;
  964. width: 44%;
  965. height: 44%;
  966. border-radius: 5px;
  967. border: 1px solid #78aee4;
  968. box-sizing: border-box;
  969. transition: all 0.3s linear;
  970. }
  971. .control-btn:hover {
  972. cursor:pointer
  973. }
  974. .control-btn i {
  975. font-size: 20px;
  976. color: #78aee4;
  977. display: flex;
  978. justify-content: center;
  979. align-items: center;
  980. }
  981. .control-btn i:hover {
  982. cursor:pointer
  983. }
  984. .control-zoom-btn:hover {
  985. cursor:pointer
  986. }
  987. .control-round {
  988. position: absolute;
  989. top: 21%;
  990. left: 21%;
  991. width: 58%;
  992. height: 58%;
  993. background: #fff;
  994. border-radius: 100%;
  995. }
  996. .control-round-inner {
  997. position: absolute;
  998. left: 13%;
  999. top: 13%;
  1000. display: flex;
  1001. justify-content: center;
  1002. align-items: center;
  1003. width: 70%;
  1004. height: 70%;
  1005. font-size: 40px;
  1006. color: #78aee4;
  1007. border: 1px solid #78aee4;
  1008. border-radius: 100%;
  1009. transition: all 0.3s linear;
  1010. }
  1011. .control-inner-btn {
  1012. position: absolute;
  1013. width: 60%;
  1014. height: 60%;
  1015. background: #fafafa;
  1016. }
  1017. .control-top {
  1018. top: -8%;
  1019. left: 27%;
  1020. transform: rotate(-45deg);
  1021. border-radius: 5px 100% 5px 0;
  1022. }
  1023. .control-top i {
  1024. transform: rotate(45deg);
  1025. border-radius: 5px 100% 5px 0;
  1026. }
  1027. .control-top .control-inner {
  1028. left: -1px;
  1029. bottom: 0;
  1030. border-top: 1px solid #78aee4;
  1031. border-right: 1px solid #78aee4;
  1032. border-radius: 0 100% 0 0;
  1033. }
  1034. .control-top .fa {
  1035. transform: rotate(45deg) translateY(-7px);
  1036. }
  1037. .control-left {
  1038. top: 27%;
  1039. left: -8%;
  1040. transform: rotate(45deg);
  1041. border-radius: 5px 0 5px 100%;
  1042. }
  1043. .control-left i {
  1044. transform: rotate(-45deg);
  1045. }
  1046. .control-left .control-inner {
  1047. right: -1px;
  1048. top: -1px;
  1049. border-bottom: 1px solid #78aee4;
  1050. border-left: 1px solid #78aee4;
  1051. border-radius: 0 0 0 100%;
  1052. }
  1053. .control-left .fa {
  1054. transform: rotate(-45deg) translateX(-7px);
  1055. }
  1056. .control-right {
  1057. top: 27%;
  1058. right: -8%;
  1059. transform: rotate(45deg);
  1060. border-radius: 5px 100% 5px 0;
  1061. }
  1062. .control-right i {
  1063. transform: rotate(-45deg);
  1064. }
  1065. .control-right .control-inner {
  1066. left: -1px;
  1067. bottom: -1px;
  1068. border-top: 1px solid #78aee4;
  1069. border-right: 1px solid #78aee4;
  1070. border-radius: 0 100% 0 0;
  1071. }
  1072. .control-right .fa {
  1073. transform: rotate(-45deg) translateX(7px);
  1074. }
  1075. .control-bottom {
  1076. left: 27%;
  1077. bottom: -8%;
  1078. transform: rotate(45deg);
  1079. border-radius: 0 5px 100% 5px;
  1080. }
  1081. .control-bottom i {
  1082. transform: rotate(-45deg);
  1083. }
  1084. .control-bottom .control-inner {
  1085. top: -1px;
  1086. left: -1px;
  1087. border-bottom: 1px solid #78aee4;
  1088. border-right: 1px solid #78aee4;
  1089. border-radius: 0 0 100% 0;
  1090. }
  1091. .control-bottom .fa {
  1092. transform: rotate(-45deg) translateY(7px);
  1093. }
  1094. .trank {
  1095. width: 80%;
  1096. height: 180px;
  1097. text-align: left;
  1098. padding: 0 10%;
  1099. overflow: auto;
  1100. }
  1101. .trankInfo {
  1102. width: 80%;
  1103. padding: 0 10%;
  1104. }
  1105. </style>