Переглянути джерело

update aura endpoints video to use youtube embed

Devon Beard 10 місяців тому
батько
коміт
80e8a48eb4

BIN
public/videos/aura/using-aura-endpoints.webm


+ 30 - 13
src/components/Video.jsx

@@ -1,21 +1,38 @@
-function Video({ src, classes }) {
+function Video({ src, classes, embed = true }) {
   return (
     <div
       className={classes}
       style={{ position: 'relative', paddingBottom: '56.25%', height: 0 }}
     >
-      <video
-        src={src}
-        className="aspect-video w-full"
-        style={{
-          position: 'absolute',
-          top: 0,
-          left: 0,
-        }}
-        controls
-        playsInline
-        preload="metadata"
-      />
+      {embed ? (
+        <iframe
+          src={src}
+          className="aspect-video w-full"
+          style={{
+            position: 'absolute',
+            top: 0,
+            left: 0,
+            width: '100%',
+            height: '100%',
+          }}
+          allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
+          referrerPolicy="strict-origin-when-cross-origin"
+          allowFullScreen
+        />
+      ) : (
+        <video
+          src={src}
+          className="aspect-video w-full"
+          style={{
+            position: 'absolute',
+            top: 0,
+            left: 0,
+          }}
+          controls
+          playsInline
+          preload="metadata"
+        />
+      )}
     </div>
   )
 }

+ 1 - 1
src/pages/aura/using-aura-endpoints.md

@@ -4,7 +4,7 @@ metaTitle: Aura Endpoints | Aura
 description: How to get started with Aura Endpoints
 ---
 
-{% video src="/videos/aura/using-aura-endpoints.webm" classes="m-auto" /%}
+{% video src="https://www.youtube.com/embed/TSkt0_t3cs4?si=d4NQxpexH0rpO2lG?&autoplay=1&mute=1" classes="m-auto" /%}
 
 ## Login to Aura