From 154966588a298be18730bfceda0350ad752f7731 Mon Sep 17 00:00:00 2001 From: irving ou Date: Wed, 8 Jan 2025 12:52:36 -0500 Subject: [PATCH] fix(dgw):remove notification from player --- webapp/player-project/index.css | 50 --------------------- webapp/player-project/index.html | 6 --- webapp/player-project/src/notification.ts | 21 --------- webapp/player-project/src/streamers/webm.ts | 9 ---- 4 files changed, 86 deletions(-) delete mode 100644 webapp/player-project/src/notification.ts diff --git a/webapp/player-project/index.css b/webapp/player-project/index.css index 86b198164..72759ea39 100644 --- a/webapp/player-project/index.css +++ b/webapp/player-project/index.css @@ -32,53 +32,3 @@ body { left: 0; top: 0; } - -/* General styles for the notification overlay */ -#notification { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */ - display: none; - justify-content: center; - align-items: center; - z-index: 9999; /* Ensure it's above other elements */ - flex-direction: column; - gap: 20px; -} - -/* Content styling for the notification box */ -#notification-content { - background-color: white; - padding: 20px; - border-radius: 8px; - box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); - max-width: 90%; - width: 400px; - text-align: center; -} - -/* Message styling */ -#notification-message { - font-size: 16px; - margin-bottom: 15px; - color: #333; -} - -/* Close button styling */ -#notification-close { - background-color: #007bff; - color: white; - border: none; - padding: 10px 20px; - border-radius: 5px; - font-size: 14px; - cursor: pointer; - transition: background-color 0.3s ease; -} - -#notification-close:hover { - background-color: #0056b3; -} diff --git a/webapp/player-project/index.html b/webapp/player-project/index.html index b8acc470d..741d0d30d 100644 --- a/webapp/player-project/index.html +++ b/webapp/player-project/index.html @@ -9,12 +9,6 @@ -
-
-

-
- -
diff --git a/webapp/player-project/src/notification.ts b/webapp/player-project/src/notification.ts deleted file mode 100644 index fe05e4caa..000000000 --- a/webapp/player-project/src/notification.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This is a very basic notification system -// We should definitely move away from plain JavaScript and use a library instead -export function showNotification(message: string, type: 'success' | 'error') { - const notification = document.getElementById('notification'); - notification.style.display = 'flex'; - const messageElement = document.getElementById('notification-message'); - messageElement.innerText = message; - - notification.className = `notification-${type}`; // Example: notification-success, notification-error - - notification.style.display = 'flex'; - - const closeButton = document.getElementById('notification-close'); - closeButton.onclick = () => { - notification.style.display = 'none'; - }; - - setTimeout(() => { - notification.style.display = 'none'; - }, 60_000); -} diff --git a/webapp/player-project/src/streamers/webm.ts b/webapp/player-project/src/streamers/webm.ts index 9d3efbb1b..9361e2b37 100644 --- a/webapp/player-project/src/streamers/webm.ts +++ b/webapp/player-project/src/streamers/webm.ts @@ -1,7 +1,6 @@ import '../../../shadow-player/src/streamer'; import { ShadowPlayer } from '../../../shadow-player/src/streamer'; import { GatewayAccessApi } from '../gateway'; -import { showNotification } from '../notification'; export async function handleWebm(gatewayAccessApi: GatewayAccessApi) { // Create element with correct spelling @@ -20,13 +19,5 @@ export async function handleWebm(gatewayAccessApi: GatewayAccessApi) { shadowPlayer.srcChange(gatewayAccessApi.sessionShadowingUrl()); shadowPlayer.play(); - shadowPlayer.onEnd(() => { - showNotification('Playback has ended', 'success'); - }); - - shadowPlayer.onError((error) => { - showNotification(`An error occurred: ${error}`, 'error'); - }); - return shadowPlayer; }