-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathvideo.html
111 lines (103 loc) · 3.51 KB
/
video.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hero component - Example page</title>
<!-- Load FontAwesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/v4-shims.min.js"
integrity="sha512-1ND726aZWs77iIUxmOoCUGluOmCT9apImcOVOcDCOSVAUxk3ZSJcuGsHoJ+i4wIOhXieZZx6rY9s6i5xEy1RPg=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- CSS only -->
<link
rel="stylesheet"
href="https://asu.github.io/asu-unity-stack/@asu/unity-bootstrap-theme/css/unity-bootstrap-theme.bundle.css"
/>
<!-- *************************************************************** -->
<script
src="https://unpkg.com/react@18.3.1/umd/react.production.min.js"
crossorigin
></script>
<script
src="https://unpkg.com/react-dom@18.3.1/umd/react-dom.production.min.js"
crossorigin
></script>
<!-- *************************************************************** -->
<!-- include bundled scripts from packages -->
<script src="../dist/libCore.umd.js"></script>
</head>
<body>
<div class="container">
<div class="container border p-4">
<section>
<h2>Default Video</h2>
<div id="default-video"></div>
</section>
<section>
<h2>Default Video with caption</h2>
<div id="default-video-with-caption"></div>
</section>
<section>
<h2>Youtube Video</h2>
<div id="youtube-video"></div>
</section>
<section>
<h2>Youtube Video with caption</h2>
<div id="youtube-video-with-caption"></div>
</section>
</div>
</div>
<script>
const videoUrl = "../src/assets/video/stock-video-person-drawing.mp4";
/**
* @typedef {{
* type?: "youtube" | "video"
* url: string
* vttUrl?: string
* title?: string
* caption?: string
* className?: string
* }} VideoProps
*/
// Setup and initialize the component
AsuWebCore.initVideo({
targetSelector: "#default-video",
props: {
type: "video", // OPTIONAL
url: videoUrl,
},
});
// Setup and initialize the component
AsuWebCore.initVideo({
targetSelector: "#default-video-with-caption",
props: {
type: "video", // OPTIONAL
url: videoUrl,
caption: "Sample video",
},
});
// Setup and initialize the component
AsuWebCore.initVideo({
targetSelector: "#youtube-video",
props: {
type: "youtube", // Required
url: "https://www.youtube.com/embed/YW2p0ctzK9c",
},
});
// Setup and initialize the component
AsuWebCore.initVideo({
targetSelector: "#youtube-video-with-caption",
props: {
type: "youtube", // Required
url: "https://www.youtube.com/embed/YW2p0ctzK9c",
caption: "Sample youtube video",
},
});
</script>
<script src="./js/example-helper.js"></script>
</body>
</html>