Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp media player #8437

Merged
merged 18 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,000 changes: 658 additions & 1,342 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
"react-infinite-scroll-component": "^6.1.0",
"react-markdown": "^8.0.7",
"react-pdf": "^9.1.0",
"react-player": "^2.16.0",
"react-redux": "^8.1.1",
"react-webcam": "^7.2.0",
"redux": "^4.2.1",
Expand Down Expand Up @@ -161,4 +160,4 @@
"node": ">=20.12.0"
},
"packageManager": "[email protected]"
}
}
17 changes: 0 additions & 17 deletions src/Common/hooks/useHLSPlayer.ts

This file was deleted.

236 changes: 0 additions & 236 deletions src/Common/hooks/useMSEplayer.ts

This file was deleted.

12 changes: 4 additions & 8 deletions src/Components/Assets/AssetType/ONVIFCamera.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import routes from "../../../Redux/api";
import useQuery from "../../../Utils/request/useQuery";

import CareIcon from "../../../CAREUI/icons/CareIcon";
import useOperateCamera from "../../CameraFeed/useOperateCamera";

interface Props {
assetId: string;
Expand Down Expand Up @@ -47,6 +48,8 @@ const ONVIFCamera = ({ assetId, facilityId, asset, onUpdated }: Props) => {
});
const authUser = useAuthUser();

const { operate } = useOperateCamera(assetId ?? "", true);

useEffect(() => {
if (asset) {
setAssetType(asset?.asset_class);
Expand Down Expand Up @@ -92,21 +95,14 @@ const ONVIFCamera = ({ assetId, facilityId, asset, onUpdated }: Props) => {

const addPreset = async (e: SyntheticEvent) => {
e.preventDefault();
const config = getCameraConfig(asset as AssetData);
const data = {
bed_id: bed.id,
preset_name: newPreset,
};
try {
setLoadingAddPreset(true);

const response = await fetch(
`https://${resolvedMiddleware?.hostname}/status?hostname=${config.hostname}&port=${config.port}&username=${config.username}&password=${config.password}`,
);
if (!response.ok) {
throw new Error("Network error");
}
const presetData = await response.json();
const { data: presetData } = await operate({ type: "get_status" });

const { res } = await request(routes.createAssetBed, {
body: {
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Assets/configure/CameraConfigure.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SyntheticEvent } from "react";
import { AssetData } from "../AssetTypes";
import LiveFeed from "../../Facility/Consultations/LiveFeed";
import CameraFeedOld from "../../CameraFeed/CameraFeedOld";
import { BedSelect } from "../../Common/BedSelect";
import { BedModel } from "../../Facility/models";
import { getCameraConfig } from "../../../Utils/transformUtils";
Expand Down Expand Up @@ -76,7 +76,7 @@ export default function CameraConfigure(props: CameraConfigureProps) {
</form>
</Card>
<Card className="mt-4">
<LiveFeed
<CameraFeedOld
middlewareHostname={facilityMiddlewareHostname}
asset={getCameraConfig(asset)}
showRefreshButton={true}
Expand Down
Loading
Loading