Skip to content

Commit 77d0ec8

Browse files
committed
Docs: mp4 thumbnail generation
1 parent eaf8970 commit 77d0ec8

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ node_modules
1818
coverage
1919
package-lock.json
2020
Makefile
21+
/index.html

docs/generator/examples.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class Examples
4444
<div class="example" id="example-${id}" tabindex="0">
4545
<video class="thumbnail" id="thumbnail-${id}" width="320" height="180" nocontrols autoplay muted loop>
4646
<source src="${example.urlBase}.webm" type="video/webm">
47+
<source src="${example.urlBase}.mp4" type="video/mp4">
4748
Your browser does not support the video tag.
4849
</video>
4950
</div>
@@ -90,7 +91,8 @@ class Examples
9091
}
9192
else
9293
{
93-
fs.copyFileSync(example.webmFilename, thumbnail);
94+
fs.copyFileSync(example.webmFilename, example.targetBasename+'.webm');
95+
fs.copyFileSync(example.mp4Filename, example.targetBasename+'.mp4');
9496
}
9597
}
9698
}
@@ -116,10 +118,13 @@ class Examples
116118
'modules/videorecorder/resized/web_content_templates_')
117119
.replace('.mjs', '.webm');
118120

121+
let mp4Filename = webmFilename.replace('.webm', '.mp4');
122+
119123
return {
120124
jsFilename,
121125
pngFilename,
122126
webmFilename,
127+
mp4Filename,
123128
outputFolder,
124129
extension
125130
};
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
*.webm
1+
*.webm
2+
*.mp4

test/integration/modules/videorecorder/resize.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ try {
2626
files.forEach(file => {
2727
if (!fs.lstatSync(__dirname + '/' + file).isDirectory()) {
2828
if (path.extname(file) == '.webm') {
29-
child_process.execSync('ffmpeg -i ' + file + ' -vf scale=' + argv.size.toString() + ':-1 ' + __dirname + '/resized/' + file)
29+
child_process.execSync('ffmpeg -i ' + file + ' -vf scale='
30+
+ argv.size.toString() + ':-1 ' + __dirname + '/resized/' + file);
31+
mp4file = file.replace('.webm', '.mp4');
32+
child_process.execSync('ffmpeg -i ' + file + ' -vf scale='
33+
+ argv.size.toString() + ':-1 ' + __dirname + '/resized/' + mp4file);
3034
}
3135
}
3236
});

test/integration/test_cases/web_content/templates/total_time_area_bar.mjs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ const testSteps = [
7979
label: { attach: ['Value 2 (+)'] }
8080
}
8181
}
82-
}),
83-
chart => {
84-
chart.feature('tooltip', true);
85-
return chart;
86-
}
82+
})
8783
];
8884

8985
export default testSteps;

0 commit comments

Comments
 (0)