Skip to main content
Whitireia & WelTec Moodle

Whakauru ki Whitireia & WelTec Moodle

Lost password?

Te wā tuatahi mōu ki kōnei?

For password reset registration click here.

For resetting your password click here.

For help and support email: lss@wandw.ac.nz

Māori - Tainui ‎(mi_tn)‎
English ‎(en)‎ Māori - Tainui ‎(mi_tn)‎ Māori - Waikato ‎(mi_wwow)‎
Kāore koe i whakauru.
Get the mobile app // Add this JavaScript to your Moodle theme or as custom JS document.addEventListener('DOMContentLoaded', function() { // Wait for Video.js to initialize setTimeout(function() { addDownloadButtons(); }, 1000); // Also run when new content loads (for AJAX pages) document.addEventListener('click', function() { setTimeout(addDownloadButtons, 500); }); }); function addDownloadButtons() { // Find all Video.js control bars that don't already have download buttons const controlBars = document.querySelectorAll('.vjs-control-bar:not(.has-download)'); controlBars.forEach(function(controlBar) { // Mark this control bar as processed controlBar.classList.add('has-download'); // Find the video element const videoPlayer = controlBar.closest('.video-js'); if (!videoPlayer) return; const videoElement = videoPlayer.querySelector('video'); if (!videoElement || !videoElement.src) return; // Create download button const downloadButton = document.createElement('button'); downloadButton.className = 'vjs-download-control vjs-control vjs-button'; downloadButton.type = 'button'; downloadButton.title = 'Download Video'; downloadButton.setAttribute('aria-disabled', 'false'); downloadButton.innerHTML = ` ⬇ Download Video `; // Add click handler downloadButton.addEventListener('click', function(e) { e.preventDefault(); e.stopPropagation(); // Create temporary download link const link = document.createElement('a'); link.href = videoElement.src; link.download = getVideoFileName(videoElement.src); link.style.display = 'none'; document.body.appendChild(link); link.click(); document.body.removeChild(link); }); // Insert before fullscreen button (or at the end) const fullscreenButton = controlBar.querySelector('.vjs-fullscreen-control'); if (fullscreenButton) { controlBar.insertBefore(downloadButton, fullscreenButton); } else { controlBar.appendChild(downloadButton); } }); } function getVideoFileName(src) { // Extract filename from URL, or use default const url = new URL(src, window.location.href); const pathname = url.pathname; const filename = pathname.substring(pathname.lastIndexOf('/') + 1); return filename || 'video.mp4'; } // CSS to style the download button const style = document.createElement('style'); style.textContent = ` .vjs-download-control { cursor: pointer; } .vjs-download-control:hover { background-color: rgba(255, 255, 255, 0.1); } .vjs-download-control .vjs-icon-placeholder { font-family: Arial, sans-serif; font-size: 16px; line-height: 1; } `; document.head.appendChild(style);
Powered by Moodle