mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
Update Birdseye.jsx
This commit is contained in:
parent
ea311661d7
commit
1442502bb5
@ -35,7 +35,7 @@ export default function Birdseye() {
|
|||||||
if ('MediaSource' in window) {
|
if ('MediaSource' in window) {
|
||||||
player = (
|
player = (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<div className={ptzCameras.length ? 'max-w-5xl xl:w-1/2' : 'w-full'}>
|
<div className={ptzCameras.length && !isMaxWidth ? 'max-w-5xl xl:w-1/2' : 'w-full'}>
|
||||||
<video-stream
|
<video-stream
|
||||||
mode="mse"
|
mode="mse"
|
||||||
src={new URL(`${baseUrl.replace(/^http/, 'ws')}live/webrtc/api/ws?src=birdseye`)}
|
src={new URL(`${baseUrl.replace(/^http/, 'ws')}live/webrtc/api/ws?src=birdseye`)}
|
||||||
@ -52,10 +52,10 @@ export default function Birdseye() {
|
|||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if (viewSource == 'webrtc' && config.birdseye.restream) {
|
} else if (viewSource == 'webrtc' ) {
|
||||||
player = (
|
player = (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<div className={ptzCameras.length ? 'max-w-5xl xl:w-1/2' : 'w-full'}>
|
<div className={ptzCameras.length && config.birdseye.restream && !isMaxWidth ? 'max-w-5xl xl:w-1/2' : 'w-full'}>
|
||||||
<WebRtcPlayer camera="birdseye" />
|
<WebRtcPlayer camera="birdseye" />
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
@ -63,8 +63,8 @@ export default function Birdseye() {
|
|||||||
} else {
|
} else {
|
||||||
player = (
|
player = (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<div className={ptzCameras.length ? 'max-w-5xl xl:w-1/2' : 'w-full'}>
|
<div className={ ptzCameras.length && config.birdseye.restream && !isMaxWidth ? 'max-w-5xl xl:w-1/2' : 'w-full' }>
|
||||||
<JSMpegPlayer camera="birdseye" height={config.birdseye.height} width={config.birdseye.width} />
|
<JSMpegPlayer camera="birdseye" />
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
@ -80,15 +80,18 @@ export default function Birdseye() {
|
|||||||
{config.birdseye.restream && (
|
{config.birdseye.restream && (
|
||||||
<select
|
<select
|
||||||
className="basis-1/8 cursor-pointer rounded dark:bg-slate-800"
|
className="basis-1/8 cursor-pointer rounded dark:bg-slate-800"
|
||||||
value={viewSource}
|
value={isMaxWidth ? "true" : "false"}
|
||||||
onChange={(e) => setViewSource(e.target.value)}
|
onChange={(e) => setIsMaxWidth(e.target.value)}
|
||||||
|
key="width-changer"
|
||||||
>
|
>
|
||||||
{sourceValues.map((item) => (
|
{sourceValues.map((item) => (
|
||||||
<option key={item} value={item}>
|
<option key={item} value={item}>
|
||||||
{item}
|
{item}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -96,7 +99,7 @@ export default function Birdseye() {
|
|||||||
{player}
|
{player}
|
||||||
|
|
||||||
{ptzCameras.length ? (
|
{ptzCameras.length ? (
|
||||||
<div className="dark:bg-gray-800 shadow-md hover:shadow-lg rounded-lg transition-shadow p-4 w-full sm:w-min xl:h-min xl:w-1/2">
|
<div className="dark:bg-gray-800 shadow-md hover:shadow-lg rounded-lg transition-shadow p-4 sm:w-min xl:h-min {playerClass}">
|
||||||
<Heading size="sm">Control Panel</Heading>
|
<Heading size="sm">Control Panel</Heading>
|
||||||
{ptzCameras.map((camera) => (
|
{ptzCameras.map((camera) => (
|
||||||
<div className="p-4" key={camera}>
|
<div className="p-4" key={camera}>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user