Quellcode durchsuchen

Load mp4 videos for better compatibility with Safari / iOS

customisations
alemart vor 1 Jahr
Ursprung
Commit
d3af586c20

BIN
demos/assets/my-video.mp4 Datei anzeigen


+ 4
- 1
demos/hello-aframe/index.html Datei anzeigen

19
             </div>
19
             </div>
20
         </div>
20
         </div>
21
         <img id="my-reference-image" src="../assets/my-reference-image.webp" hidden>
21
         <img id="my-reference-image" src="../assets/my-reference-image.webp" hidden>
22
-        <video id="my-video" src="../assets/my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
22
+        <video id="my-video" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
23
+            <source src="../assets/my-video.webm" type="video/webm" />
24
+            <source src="../assets/my-video.mp4" type="video/mp4" />
25
+        </video>
23
 
26
 
24
         <!-- This is a scene -->
27
         <!-- This is a scene -->
25
         <a-scene ar-scene>
28
         <a-scene ar-scene>

+ 4
- 1
demos/hello-three/index.html Datei anzeigen

19
             </div>
19
             </div>
20
         </div>
20
         </div>
21
         <img id="my-reference-image" src="../assets/my-reference-image.webp" hidden>
21
         <img id="my-reference-image" src="../assets/my-reference-image.webp" hidden>
22
-        <video id="my-video" src="../assets/my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
22
+        <video id="my-video" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
23
+            <source src="../assets/my-video.webm" type="video/webm" />
24
+            <source src="../assets/my-video.mp4" type="video/mp4" />
25
+        </video>
23
     </body>
26
     </body>
24
 </html>
27
 </html>

+ 4
- 1
demos/hello-webgl/index.html Datei anzeigen

18
         <img id="it-works" src="../assets/it-works.png" hidden>
18
         <img id="it-works" src="../assets/it-works.png" hidden>
19
         <img id="bird" src="../assets/bird.png" hidden>
19
         <img id="bird" src="../assets/bird.png" hidden>
20
         <img id="my-reference-image" src="../assets/my-reference-image.webp" hidden>
20
         <img id="my-reference-image" src="../assets/my-reference-image.webp" hidden>
21
-        <video id="my-video" src="../assets/my-video.webm" hidden muted loop autoplay playsinline oncanplay="this.muted=true;this.play()"></video>
21
+        <video id="my-video" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
22
+            <source src="../assets/my-video.webm" type="video/webm" />
23
+            <source src="../assets/my-video.mp4" type="video/mp4" />
24
+        </video>
22
     </body>
25
     </body>
23
 </html>
26
 </html>

+ 4
- 1
demos/hello-world/index.html Datei anzeigen

16
             </div>
16
             </div>
17
         </div>
17
         </div>
18
         <img id="my-reference-image" src="../assets/my-reference-image.webp" hidden>
18
         <img id="my-reference-image" src="../assets/my-reference-image.webp" hidden>
19
-        <video id="my-video" src="../assets/my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
19
+        <video id="my-video" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
20
+            <source src="../assets/my-video.webm" type="video/webm" />
21
+            <source src="../assets/my-video.mp4" type="video/mp4" />
22
+        </video>
20
     </body>
23
     </body>
21
 </html>
24
 </html>

+ 4
- 1
demos/touch-interaction/index.html Datei anzeigen

20
             </div>
20
             </div>
21
         </div>
21
         </div>
22
         <img id="my-reference-image" src="../assets/my-reference-image.webp" hidden>
22
         <img id="my-reference-image" src="../assets/my-reference-image.webp" hidden>
23
-        <video id="my-video" src="../assets/my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
23
+        <video id="my-video" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
24
+            <source src="../assets/my-video.webm" type="video/webm" />
25
+            <source src="../assets/my-video.mp4" type="video/mp4" />
26
+        </video>
24
     </body>
27
     </body>
25
 </html>
28
 </html>

BIN
docs/assets/my-video.mp4 Datei anzeigen


+ 8
- 2
docs/getting-started/activate-your-webcam.md Datei anzeigen

60
         <div id="ar-viewport"></div>
60
         <div id="ar-viewport"></div>
61
         <img id="my-reference-image" src="my-reference-image.webp" hidden>
61
         <img id="my-reference-image" src="my-reference-image.webp" hidden>
62
         <!--
62
         <!--
63
-        <video id="my-video" src="my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
63
+        <video id="my-video" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
64
+            <source src="my-video.webm" type="video/webm" />
65
+            <source src="my-video.mp4" type="video/mp4" />
66
+        </video>
64
         -->
67
         -->
65
     </body>
68
     </body>
66
 </html>
69
 </html>
139
         </div>
142
         </div>
140
         <img id="my-reference-image" src="my-reference-image.webp" hidden>
143
         <img id="my-reference-image" src="my-reference-image.webp" hidden>
141
         <!--
144
         <!--
142
-        <video id="my-video" src="my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
145
+        <video id="my-video" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
146
+            <source src="my-video.webm" type="video/webm" />
147
+            <source src="my-video.mp4" type="video/mp4" />
148
+        </video>
143
         -->
149
         -->
144
     </body>
150
     </body>
145
 </html>
151
 </html>

+ 14
- 7
docs/getting-started/create-the-augmented-scene.md Datei anzeigen

30
 
30
 
31
 Writing a glue code is a task of moderate complexity. It requires dealing with matrices, with performance issues, and with some idiosyncrasies of the 3D rendering technologies in order to make sure it all works as intended. It is advisable to have specialized knowledge of computer graphics programming in order to write a glue code that works correctly.
31
 Writing a glue code is a task of moderate complexity. It requires dealing with matrices, with performance issues, and with some idiosyncrasies of the 3D rendering technologies in order to make sure it all works as intended. It is advisable to have specialized knowledge of computer graphics programming in order to write a glue code that works correctly.
32
 
32
 
33
-I provide easy-to-use glue codes that work with different 3D rendering technologies in my demos, so that you don't need to deal with the complexity. Those glue codes are JavaScript (.js) files. You just need to add a glue code to your web page (e.g., via a `<script>` tag) and then the integration will be done for you. It's really that simple! Also, my glue codes may be used in both free and non-free projects.
33
+I provide easy-to-use glue codes that work with different 3D rendering technologies in my demos, so that you don't need to deal with the complexity. Those glue codes are JavaScript (.js) files. You just need to add a glue code to your web page (e.g., via a `<script>` tag) and then the integration will be done for you. It's really that simple!
34
 
34
 
35
-[:octocat: Get the glue codes on GitHub](https://github.com/alemart/martins-js/tree/master/dist){ .md-button ._blank }
36
-
37
-[Get the glue codes in my demos](../gallery.md){ .md-button ._blank }
35
+[Find the glue codes in my demos](../gallery.md){ .md-button ._blank }
38
 
36
 
39
 ## Create the virtual scene
37
 ## Create the virtual scene
40
 
38
 
41
 Once you plug in the glue code, you'll be using the 3D rendering technology of your choice to create the virtual scene. The physical scene will be automatically augmented with the virtual scene, thus creating the augmented scene.
39
 Once you plug in the glue code, you'll be using the 3D rendering technology of your choice to create the virtual scene. The physical scene will be automatically augmented with the virtual scene, thus creating the augmented scene.
42
 
40
 
43
 <figure markdown>
41
 <figure markdown>
44
-<video src="../../img/demo-cool2.webm" poster="../../img/demo-cool2.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
42
+<video poster="../../img/demo-cool2.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
43
+    <source src="../../img/demo-cool2.webm" type="video/webm" />
44
+    <source src="../../img/demo-cool2.mp4" type="video/mp4" />
45
+</video>
45
 <figcaption markdown>An augmented scene with a [3D model](../assets/my-3d-model.glb "A public domain 3D model from Kenney, converted to glTF format") from [Kenney](https://www.kenney.nl){ ._blank }</figcaption>
46
 <figcaption markdown>An augmented scene with a [3D model](../assets/my-3d-model.glb "A public domain 3D model from Kenney, converted to glTF format") from [Kenney](https://www.kenney.nl){ ._blank }</figcaption>
46
 </figure>
47
 </figure>
47
 
48
 
48
 <figure markdown>
49
 <figure markdown>
49
-<video src="../../img/demo-cool.webm" poster="../../img/demo-cool.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
50
+<video poster="../../img/demo-cool.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
51
+    <source src="../../img/demo-cool.webm" type="video/webm" />
52
+    <source src="../../img/demo-cool.mp4" type="video/mp4" />
53
+</video>
50
 <figcaption markdown>A similar augmented scene viewed from a different perspective</figcaption>
54
 <figcaption markdown>A similar augmented scene viewed from a different perspective</figcaption>
51
 </figure>
55
 </figure>
52
 
56
 
76
     <body>
80
     <body>
77
         <div id="ar-viewport"></div>
81
         <div id="ar-viewport"></div>
78
         <img id="my-reference-image" src="my-reference-image.webp" hidden>
82
         <img id="my-reference-image" src="my-reference-image.webp" hidden>
79
-        <video id="my-video" src="my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
83
+        <video id="my-video" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
84
+            <source src="my-video.webm" type="video/webm" />
85
+            <source src="my-video.mp4" type="video/mp4" />
86
+        </video>
80
 
87
 
81
         <!-- This is a scene -->
88
         <!-- This is a scene -->
82
         <a-scene ar-scene>
89
         <a-scene ar-scene>

+ 8
- 2
docs/getting-started/introduction.md Datei anzeigen

5
 Traditionally, users were required to download (sometimes large) apps to experience AR. That was an obstacle for adoption. What if we dropped the need for apps and just required a web browser instead? Users already have web browsers! That's where WebAR comes in.
5
 Traditionally, users were required to download (sometimes large) apps to experience AR. That was an obstacle for adoption. What if we dropped the need for apps and just required a web browser instead? Users already have web browsers! That's where WebAR comes in.
6
 
6
 
7
 <figure markdown>
7
 <figure markdown>
8
-<video src="../../img/demo-cool.webm" poster="../../img/demo-cool.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
8
+<video poster="../../img/demo-cool.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
9
+    <source src="../../img/demo-cool.webm" type="video/webm" />
10
+    <source src="../../img/demo-cool.mp4" type="video/mp4" />
11
+</video>
9
 <figcaption>A WebAR demo created with MARTINS.js</figcaption>
12
 <figcaption>A WebAR demo created with MARTINS.js</figcaption>
10
 </figure>
13
 </figure>
11
 
14
 
16
 No matter if you are a beginner, an expert, or somewhere in-between, set yourself at ease: this step-by-step guide can be followed by you.
19
 No matter if you are a beginner, an expert, or somewhere in-between, set yourself at ease: this step-by-step guide can be followed by you.
17
 
20
 
18
 <figure markdown>
21
 <figure markdown>
19
-<video src="../../img/demo-cool3.webm" poster="../../img/demo-cool3.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
22
+<video poster="../../img/demo-cool3.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
23
+    <source src="../../img/demo-cool3.webm" type="video/webm" />
24
+    <source src="../../img/demo-cool3.mp4" type="video/mp4" />
25
+</video>
20
 <figcaption>Augmented Reality based on Image Tracking</figcaption>
26
 <figcaption>Augmented Reality based on Image Tracking</figcaption>
21
 </figure>
27
 </figure>
22
 
28
 

+ 4
- 1
docs/getting-started/set-up-the-session.md Datei anzeigen

20
     <body>
20
     <body>
21
         <div id="ar-viewport"></div>
21
         <div id="ar-viewport"></div>
22
         <img id="my-reference-image" src="my-reference-image.webp" hidden>
22
         <img id="my-reference-image" src="my-reference-image.webp" hidden>
23
-        <video id="my-video" src="my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
23
+        <video id="my-video" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
24
+            <source src="my-video.webm" type="video/webm" />
25
+            <source src="my-video.mp4" type="video/mp4" />
26
+        </video>
24
     </body>
27
     </body>
25
 </html>
28
 </html>
26
 ```
29
 ```

+ 15
- 4
docs/getting-started/set-up-the-tracker.md Datei anzeigen

62
 
62
 
63
 ## Add a test video
63
 ## Add a test video
64
 
64
 
65
-We're going to be tracking that reference image in a test video. Please save the following video as [my-video.webm](../assets/my-video.webm){ ._blank } in `ar-demo/`. Later on I'll tell you how to use your webcam instead.
65
+We're going to be tracking that reference image in a test video. Please save the following video as [my-video.webm](../assets/my-video.webm){ ._blank } and [my-video.mp4](../assets/my-video.mp4){ ._blank } in `ar-demo/`. Later on I'll tell you how to use your webcam instead.
66
 
66
 
67
 <figure markdown>
67
 <figure markdown>
68
-<video src="../../assets/my-video.webm" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
68
+<video style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
69
+    <source src="../../assets/my-video.webm" type="video/webm" />
70
+    <source src="../../assets/my-video.mp4" type="video/mp4" />
71
+</video>
69
 </figure>
72
 </figure>
70
 
73
 
71
 This is the expected directory structure at this point:
74
 This is the expected directory structure at this point:
74
     ├── index.html
77
     ├── index.html
75
     ├── martins.js
78
     ├── martins.js
76
     ├── my-reference-image.webp
79
     ├── my-reference-image.webp
80
+    ├── my-video.mp4
77
     └── my-video.webm
81
     └── my-video.webm
78
 
82
 
79
 Let's include the test video in our page. Add a `<video>` tag as follows:
83
 Let's include the test video in our page. Add a `<video>` tag as follows:
90
     </head>
94
     </head>
91
     <body>
95
     <body>
92
         <img id="my-reference-image" src="my-reference-image.webp" hidden>
96
         <img id="my-reference-image" src="my-reference-image.webp" hidden>
93
-        <video id="my-video" src="my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
97
+        <video id="my-video" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
98
+            <source src="my-video.webm" type="video/webm" />
99
+            <source src="my-video.mp4" type="video/mp4" />
100
+        </video>
94
     </body>
101
     </body>
95
 </html>
102
 </html>
96
 ```
103
 ```
116
     </head>
123
     </head>
117
     <body>
124
     <body>
118
         <img id="my-reference-image" src="my-reference-image.webp" hidden>
125
         <img id="my-reference-image" src="my-reference-image.webp" hidden>
119
-        <video id="my-video" src="my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
126
+        <video id="my-video" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
127
+            <source src="my-video.webm" type="video/webm" />
128
+            <source src="my-video.mp4" type="video/mp4" />
129
+        </video>
120
     </body>
130
     </body>
121
 </html>
131
 </html>
122
 ```
132
 ```
153
     ├── index.html
163
     ├── index.html
154
     ├── martins.js
164
     ├── martins.js
155
     ├── my-reference-image.webp
165
     ├── my-reference-image.webp
166
+    ├── my-video.mp4
156
     └── my-video.webm
167
     └── my-video.webm
157
 
168
 
158
 ## Link the image to the tracker
169
 ## Link the image to the tracker

BIN
docs/img/demo-cool.mp4 Datei anzeigen


BIN
docs/img/demo-cool2.mp4 Datei anzeigen


BIN
docs/img/demo-cool3.mp4 Datei anzeigen


BIN
docs/img/splash.mp4 Datei anzeigen


+ 4
- 1
docs_overrides/home.html Datei anzeigen

115
             <a href="{{ './demo/instructions' | url }}" class="md-button">Try a demo</a>
115
             <a href="{{ './demo/instructions' | url }}" class="md-button">Try a demo</a>
116
         </div>
116
         </div>
117
         <div class="splash-image">
117
         <div class="splash-image">
118
-            <video src="{{ './img/splash.webm' | url }}" poster="{{ './img/splash.webp' | url }}" muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
118
+            <video poster="{{ './img/splash.webp' | url }}" muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
119
+                <source src="{{ './img/splash.webm' | url }}" type="video/webm" />
120
+                <source src="{{ './img/splash.mp4' | url }}" type="video/mp4" />
121
+            </video>
119
         </div>
122
         </div>
120
     </div>
123
     </div>
121
 </section>
124
 </section>

Laden…
Abbrechen
Speichern