EasyNVRを使用する多くのお客様は、ptzコントロールを使用してビデオを制御することを望んでいますが、実際の統合には問題があることがよくあります。このブログ投稿では、カスタムプレーヤーがptzスペースを統合する方法を具体的に紹介します。
H5ライブオンデマンドプレーヤーの使用手順:https : //www.npmjs.com/package/@easydarwin/easyplayer
上記のリンクを参照できます。リンクの内容をもとにケースを再現してみましょう。
プレーヤーは、ビデオの上にあるDIVメソッドをカスタマイズします
タグ内のdivがビデオウィンドウの上に自動的に表示されます。コードは次のとおりです。
<EasyPlayer id="player01" video-url="http://192.168.2.135:10080/vhls/0XpHAMvWR/0XpHAMvWR_live.m3u8" live="true" aspect="16:9" stretch="true"> <div style="position:absolute;left:15px;top:15px;color:#FFF;">自定义叠加层</div> </EasyPlayer>
<EasyPlayer :muted="muted" :videoUrl="videoUrl" :poster="poster" :aspect="aspect" live :fluent="fluent" :stretch="stretch" :autoplay="autoplay" :controls="controls">
<div class="ptz-block" v-show="ptz">
<div class="ptz-cell ptz-up" @mousedown.prevent="ptzControl('up', $event)" title="上">
<i class="fa fa-chevron-up"></i>
</div>
<div class="ptz-cell ptz-left" @mousedown.prevent="ptzControl('left', $event)" title="左">
<i class="fa fa-chevron-left"></i>
</div>
<div class="ptz-center" title="云台控制">
<i class="fa fa-arrows"></i>
</div>
<div class="ptz-cell ptz-right" @mousedown.prevent="ptzControl('right', $event)" title="右">
<i class="fa fa-chevron-right"></i>
</div>
<div class="ptz-cell ptz-down" @mousedown.prevent="ptzControl('down', $event)" title="下">
<i class="fa fa-chevron-down"></i>
</div>
<div class="ptz-cell ptz-plus" @mousedown.prevent="ptzControl('zoomin', $event)" title="缩">
<i class="fa fa-plus-circle"></i>
</div>
<div class="ptz-cell ptz-minus" @mousedown.prevent="ptzControl('zoomout', $event)" title="放">
<i class="fa fa-minus-circle"></i>
</div>
</div>
</EasyPlayer>
.ptz-block {
position: absolute;
z-index: 99999;
width: 150px;
height: 220px;
right: 20px;
top: 20px;
text-align: center;
font-size: 24px;
background: fade(#eee, 0%);
border-radius: 16px;
overflow: hidden;
&:hover {
background: fade(#eee, 60%);
.ptz-cell,
.ptz-cells {
display: block;
}
}
.ptz-cells,
.ptz-cell {
width: 50px;
height: 50px;
line-height: 50px;
position: absolute;
cursor: pointer;
display: none;
}
.ptz-cell.active {
color: #ccc;
font-size: 26px;
}
.ptz-center {
top: 120px;
left: 50px;
width: 50px;
height: 50px;
line-height: 50px;
position: absolute;
border-radius: 25px;
background: fade(#ccc, 20%);
cursor: move;
i {
color: fade(#000, 30%);
}
}
.ptz-up {
top: 70px;
left: 50px;
}
.ptz-left {
top: 120px;
left: 0;
}
.ptz-right {
top: 120px;
left: 100px;
}
.ptz-down {
top: 165px;
left: 50px;
}
.ptz-plus {
top: 25px;
left: 5px;
}
.ptz-speed {
left: 52px;
width: 45px;
top: 20px;
.el-input-number--mini {
width: 50px;
color: fade(#000, 30%);
}
}
.ptz-minus {
top: 25px;
left: 95px;
}
}
EasyPlayerプレーヤーについて
EasyPlayerは一連のストリーミングメディアプレーヤープロジェクトで、RTSP、RTMP、HTTP、HLS、UDP、RTP、ファイルおよびその他のストリーミングメディアプロトコルの再生をサポートし、ローカルファイルの再生をサポートし、ローカルキャプチャ、ローカルビデオ、再生回転、マルチスクリーンをサポートしますコアはffmpegに基づいており、安定性、効率性、信頼性が高く、制御可能です。
EasyPlayerプレーヤーシリーズプロジェクトは、非常にシンプルで使いやすいSDKおよびAPIインターフェイスを提供します。ユーザーは、2回目の開発のAPI呼び出しを介して、独自のアプリケーションをすばやく開発できます。このプロジェクトに興味がある場合は、お問い合わせいただくか、TSINGSEE Qingxi Videoにアクセスして詳細をご確認ください。