attempt fix

This commit is contained in:
overcuriousity 2025-08-12 23:03:31 +02:00
parent 4fd257cbd6
commit be76f2be5a
3 changed files with 4 additions and 28 deletions

View File

@ -18,7 +18,7 @@ sections:
advanced_topics: true
review_status: "published"
---
<video src="https://cloud.cc24.dev/s/ZmPK86M86fWyGQk" controls title="Training Video"></video>
<video src="https://cloud.cc24.dev/s/ZmPK86M86fWyGQk" controls title="Training Video" type="video/mp4"></video>
> **⚠️ Hinweis**: Dies ist ein vorläufiger, KI-generierter Knowledgebase-Eintrag. Wir freuen uns über Verbesserungen und Ergänzungen durch die Community!

View File

@ -364,13 +364,6 @@ const { title, description = 'ForensicPathways - A comprehensive directory of di
errorCount++;
console.log(`[VIDEO] Error ${errorCount} in Firefox for: ${video.getAttribute('data-video-title')}`);
if (errorCount === 1 && video.src.includes('/download')) {
console.log('[VIDEO] Trying /preview URL for Firefox compatibility');
video.src = video.src.replace('/download', '/preview');
video.load();
} else if (errorCount === 1) {
console.log('[VIDEO] Video failed to load in Firefox');
}
});
video.addEventListener('loadedmetadata', () => {

View File

@ -15,9 +15,7 @@ export const remarkVideoPlugin: Plugin<[], Root> = () => {
if (srcMatch) {
const originalSrc = srcMatch[1];
const title = titleMatch?.[1] || 'Video';
const finalSrc = processNextcloudUrl(originalSrc);
const hasControls = node.value.includes('controls');
const hasAutoplay = node.value.includes('autoplay');
const hasMuted = node.value.includes('muted');
@ -27,7 +25,7 @@ export const remarkVideoPlugin: Plugin<[], Root> = () => {
const enhancedHTML = `
<div class="video-container aspect-16-9">
<video
src="${escapeHtml(finalSrc)}"
src="${escapeHtml(originalSrc)}"
${hasControls ? 'controls' : ''}
${hasAutoplay ? 'autoplay' : ''}
${hasMuted ? 'muted' : ''}
@ -50,7 +48,7 @@ export const remarkVideoPlugin: Plugin<[], Root> = () => {
parent.children[index] = { type: 'html', value: enhancedHTML };
console.log(`[VIDEO] Processed: ${title}`);
console.log(`[VIDEO] Final URL: ${finalSrc}`);
console.log(`[VIDEO] Final URL: ${originalSrc}`);
}
}
});
@ -58,21 +56,6 @@ export const remarkVideoPlugin: Plugin<[], Root> = () => {
};
function processNextcloudUrl(originalUrl: string): string {
if (isNextcloudShareUrl(originalUrl) && !originalUrl.includes('/download')) {
const downloadUrl = `${originalUrl}/download`;
console.log(`[VIDEO] Auto-added /download: ${originalUrl}${downloadUrl}`);
return downloadUrl;
}
return originalUrl;
}
function isNextcloudShareUrl(url: string): boolean {
const pattern = /\/s\/[a-zA-Z0-9]+/;
return pattern.test(url) && (url.includes('nextcloud') || url.includes('cloud.'));
}
function escapeHtml(unsafe: string): string {
if (typeof unsafe !== 'string') return '';