- Newest
- Most votes
- Most comments
- Update your CSS: Make sure your CSS is set up to allow the DCV display to take up the full viewport. Add these styles:
html, body, #dcv-display { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; }
- Modify the resizeDisplay function: Update your resizeDisplay function to use the full viewport dimensions:
function resizeDisplay() { let display = document.getElementById('dcv-display'); // Set the canvas size to match the viewport dimensions display.style.width = '100vw'; display.style.height = '100vh'; // Get the actual dimensions of the display element const displayRect = display.getBoundingClientRect(); const width = Math.floor(displayRect.width); const height = Math.floor(displayRect.height); console.log(`Requesting resolution change to ${width}x${height}`); if (connection && connection.setResolution) { connection.setResolution(width, height) .then(() => { console.log(`Resolution successfully set to ${width}x${height}`); }) .catch(err => { console.error('Failed to set resolution:', err); }); } else { console.error('connection.setResolution is not available'); } }
- Call resizeDisplay on window resize: Add an event listener to handle window resizing:
window.addEventListener('resize', resizeDisplay);
-
Update server-side configuration: Ensure that your NICE DCV server is configured to allow resolution changes. You may need to modify the server configuration to allow larger resolutions.
-
Adjust the create-session command: When starting your DCV session, you can specify the initial resolution. Modify your command to use a larger initial resolution:
dcv create-session --owner dcv --init init.sh --max-concurrent-clients 1 --storage-root /home/dcv --resolution 1920x1080 elliot
Adjust the resolution (1920x1080 in this example) to match your desired initial size.
- Handle full-screen mode: Implement a function to request full-screen mode and call it when appropriate:
function requestFullScreen(element) { if (element.requestFullscreen) { element.requestFullscreen(); } else if (element.mozRequestFullScreen) { element.mozRequestFullScreen(); } else if (element.webkitRequestFullscreen) { element.webkitRequestFullscreen(); } else if (element.msRequestFullscreen) { element.msRequestFullscreen(); } } // Call this function when you want to enter full-screen mode requestFullScreen(document.getElementById('dcv-display'));
By implementing these changes, your NICE DCV display should adjust to the full width and height of your device's screen. Remember to test on different devices and screen sizes to ensure it works as expected across various displays.
Sources
Connect to the head and login nodes through NICE DCV - AWS ParallelCluster
Starting Amazon DCV sessions - Amazon DCV
NICE DCV Releases Version 2019.0 with Multi-Monitor Support on Web Client
Relevant content
- asked 18 days ago
- asked 3 months ago
- Accepted Answerasked 5 months ago
- AWS OFFICIALUpdated 20 days ago
- AWS OFFICIALUpdated 6 days ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated a month ago
i know this is Ai generated, but there's no dcv command like
--resolution