// Method 2: Find video links in SharePoint players const videoContainers = document.querySelectorAll('[data-video-url], [data-src*="video"], [data-filepath]'); videoContainers.forEach(container => container.getAttribute('data-filepath'); if (videoUrl && videoUrl.includes('.mp4') );
// Method 3: Find video links in iframes const iframes = document.querySelectorAll('iframe'); iframes.forEach(iframe => iframe.src.includes('streaming'))) videos.push( url: iframe.src, filename: 'sharepoint_stream_video.mp4' ); download sharepoint video chrome extension
// Method 1: Find video elements const videoElements = document.querySelectorAll('video'); videoElements.forEach(video => if (video.src) videos.push( url: video.src, filename: extractFilename(video.src) ); // Method 2: Find video links in SharePoint
// Remove duplicates const uniqueVideos = Array.from(new Map(videos.map(v => [v.url, v])).values()); if (videoUrl && videoUrl.includes('.mp4') )
return uniqueVideos;
// Add download event listeners document.querySelectorAll('.download-btn').forEach(btn => btn.addEventListener('click', (e) => 'sharepoint_video.mp4'; downloadVideo(url, filename); ); );
videos.forEach((video, index) => const videoDiv = document.createElement('div'); videoDiv.className = 'video-item'; videoDiv.innerHTML = <strong>Video $index + 1</strong><br> <small>$video.filename </small><br> <button class="download-btn" data-url="$video.url" data-name="$video.filename"> ⬇️ Download </button> ; videoList.appendChild(videoDiv); );