Skip to content

Commit 86e8ff2

Browse files
committed
Got automatic video embed to work
1 parent 5015192 commit 86e8ff2

File tree

6 files changed

+55
-49
lines changed

6 files changed

+55
-49
lines changed

_includes/screencontent.html

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
2+
3+
{% for file in site.static_files %}
4+
{% if file.path contains 'assets/videos' %}
5+
{% if file.extname == ".mov" %}
6+
<script>
7+
$(function() {
8+
$(".videoContainer").removeClass("hidden");
9+
$(".screenvideo").append('<source src="{{ file.path }}" type="video/mp4">');
10+
console.log("{{ file.path }}");
11+
});
12+
</script>
13+
{% elsif file.extname == ".ogg" %}
14+
<script>
15+
$(function() {
16+
$(".videoContainer").removeClass("hidden");
17+
$(".screenvideo").append('<source src="{{ file.path }}" type="video/ogg">');
18+
console.log("{{ file.path }}");
19+
});
20+
</script>
21+
{% endif %}
22+
{% else %}
23+
{% if file.path contains 'assets/screenshot' %}
24+
<script>
25+
(".iphoneScreen").removeClass("hidden");
26+
</script>
27+
{% endif %}
28+
{% endif %}
29+
{% endfor %}
30+
31+
32+
33+
34+
35+
<!--
36+
<div class="videoContainer">
37+
<video autoplay="autoplay" controls="controls">
38+
{% if video.extname == ".ogg" %}
39+
<source src="{{ video.path }}" type="video/ogg">
40+
{% endif %}
41+
42+
{% if video.extname == ".mov" %}
43+
<source src="{{ video.path }}" type="video/mp4">
44+
{% endif %}
45+
</video>
46+
</div>
47+
48+
-->

_includes/videoembed.html

Lines changed: 0 additions & 37 deletions
This file was deleted.

_layouts/default.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
</clipPath>
1717
</svg>
1818

19-
<div class="videoContainer hide">
20-
<video autoplay="autoplay" controls="controls">
21-
<source src="" type="video/ogg">
22-
<source src="" type="video/mp4">
19+
<div class="videoContainer hidden">
20+
<video class="screenvideo" autoplay="autoplay" controls="controls">
21+
<!--<source src="assets/videos/yourvideo.ogg" type="video/ogg">
22+
<source src="assets/videos/yourvideo.mov" type="video/mp4">-->
2323
</video>
2424
</div>
2525

26-
<img class="iphoneScreen hide" src="{{ image.path }}" alt="">
26+
<img class="iphoneScreen hidden" src="{{ image.path }}" alt="">
2727

28-
{% include videoembed.html %}
28+
{% include screencontent.html %}
2929

3030
</div>
3131
<div class="appInfo">

_sass/layout.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,6 @@ footer {
454454
display: flex;
455455
}
456456

457-
.hide {
457+
.hidden {
458458
visibility: hidden;
459459
}

assets/layout.png

-1.62 MB
Binary file not shown.

assets/screen.svg

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)