Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/PixelStreamingInfrastructure.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Extras/JSStreamer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"ts-loader": "^9.5.2",
"typescript": "^5.7.3",
"typescript-eslint": "^8.24.0",
"webpack": "^5.97.1",
"webpack": "^5.104.1",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.0",
"webpack-dev-server": "^5.2.1",
"webpack-node-externals": "^3.0.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion Frontend/implementations/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"html-webpack-plugin": "^5.6.3",
"ts-loader": "^9.5.2",
"typescript": "^5.7.3",
"webpack": "^5.97.1",
"webpack": "^5.104.1",
"webpack-cli": "^6.0.1"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion Frontend/implementations/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"html-loader": "^5.1.0",
"html-webpack-plugin": "^5.6.3",
"ts-loader": "^9.5.2",
"webpack": "^5.97.1",
"webpack": "^5.104.1",
"webpack-cli": "^6.0.1"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions Frontend/library/src/VideoPlayer/StreamController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class StreamController {
videoElement.srcObject !== rtcTrackEvent.streams[0]
) {
videoElement.srcObject = rtcTrackEvent.streams[0];
this.videoElementProvider.switchToWebRTCStream();
Logger.Info('Set video source from video track ontrack.');
return;
}
Expand Down
22 changes: 20 additions & 2 deletions Frontend/library/src/VideoPlayer/VideoPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,27 @@ export class VideoPlayer {
private audioElement?: HTMLAudioElement;
private orientationChangeTimeout: number;
private lastTimeResized = new Date().getTime();

onMatchViewportResolutionCallback: (width: number, height: number) => void;
onResizePlayerCallback: () => void;
resizeTimeoutHandle: number;

private placeholderVideo: HTMLVideoElement;
/**
* @param videoElementParent the html div the the video player will be injected into
* @param config the applications configuration. We're interested in the startVideoMuted flag
*/
constructor(videoElementParent: HTMLElement, config: Config) {

this.placeholderVideo = document.createElement('video');
this.placeholderVideo.id = 'placeholderVideo';
this.placeholderVideo.src = './video/1.mp4'; // Set path to your local video
this.placeholderVideo.controls = false;
this.placeholderVideo.autoplay = true;
this.placeholderVideo.loop = true;
this.placeholderVideo.muted = true;
this.placeholderVideo.style.width = '100%';
this.placeholderVideo.style.height = '100%';
this.placeholderVideo.style.position = 'absolute';

this.videoElement = document.createElement('video');
this.config = config;
this.videoElement.id = 'streamingVideo';
Expand All @@ -41,6 +52,7 @@ export class VideoPlayer {
this.videoElement.style.position = 'absolute';
this.videoElement.style.pointerEvents = 'all';
videoElementParent.appendChild(this.videoElement);
videoElementParent.appendChild(this.placeholderVideo);

this.onResizePlayerCallback = () => {
console.log('Resolution changed, restyling player, did you forget to override this function?');
Expand Down Expand Up @@ -74,6 +86,12 @@ export class VideoPlayer {
this.audioElement = audioElement;
}

// Method to switch from placeholder to WebRTC stream
public switchToWebRTCStream(): void {
this.placeholderVideo.style.display = 'none';
this.videoElement.style.display = 'block';
}

/**
* Sets up the video element with any application config and plays the video element.
* @returns A promise for if playing the video was successful or not.
Expand Down
2 changes: 2 additions & 0 deletions Frontend/ui-library/src/Overlay/DisconnectOverlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export class DisconnectOverlay extends ActionOverlay {
const disconnectOverlayHtml = document.createElement('div');
disconnectOverlayHtml.id = 'disconnectOverlay';
disconnectOverlayHtml.className = 'clickableState';
disconnectOverlayHtml.style.background = 'rgba(0, 0, 0, 0.3)'; // Semi-transparent black overlay
disconnectOverlayHtml.style.transition = 'opacity 0.8s ease-in-out';
return disconnectOverlayHtml;
}

Expand Down
4 changes: 3 additions & 1 deletion Frontend/ui-library/src/UI/FullscreenIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ export class FullScreenIcon extends FullScreenIconBase {
createdButton.appendChild(this.maximizeIcon);
createdButton.appendChild(this.minimizeIcon);
createdButton.appendChild(this.tooltipText);

createdButton.style.position = 'absolute'; // Change to 'fixed' if you want it to stay in the same place even when scrolling
createdButton.style.top = '1px'; // Adjust vertical position
createdButton.style.left = '60px'; // Adjust horizontal position
this.rootElement = createdButton;
}

Expand Down
1 change: 1 addition & 0 deletions Frontend/ui-library/src/UI/SettingsIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class SettingsIcon {
this._rootElement.id = 'settingsBtn';
this._rootElement.appendChild(this.settingsIcon);
this._rootElement.appendChild(this.tooltipText);
this._rootElement.setAttributeNS(null, 'style', 'display: None;');
}
return this._rootElement;
}
Expand Down
2 changes: 1 addition & 1 deletion Frontend/ui-library/src/UI/StatsIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class StatsIcon {
this._rootElement.id = 'statsBtn';
this._rootElement.appendChild(this.statsIcon);
this._rootElement.appendChild(this.tooltipText);
this._rootElement.setAttributeNS(null, 'style', 'display: None;');
}
return this._rootElement;
}
Expand All @@ -39,7 +40,6 @@ export class StatsIcon {
this._statsIcon.setAttributeNS(null, 'x', '0px');
this._statsIcon.setAttributeNS(null, 'y', '0px');
this._statsIcon.setAttributeNS(null, 'viewBox', '0 0 330 330');

// create svg group for the paths
const svgGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
svgGroup.classList.add('svgIcon');
Expand Down
3 changes: 3 additions & 0 deletions Frontend/ui-library/src/UI/VideoQpIndicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export class VideoQpIndicator {
this._rootElement = document.createElement('div');
this._rootElement.id = 'connection';
this._rootElement.classList.add('UiTool');
this._rootElement.style.position = 'absolute'; // Change to 'fixed' if you want it to stay in the same place even when scrolling
this._rootElement.style.top = '25px'; // Adjust vertical position
this._rootElement.style.left = '20px'; // Adjust horizontal position

// add svg icon for the connection strength
this._rootElement.appendChild(this.qualityStatus);
Expand Down
Loading