Skip to content

Commit 515bd04

Browse files
authored
switch video to mp4 for emscripten - adding muting (#7637)
1 parent 82522d8 commit 515bd04

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

addons/ofxEmscripten/libs/html5video/lib/emscripten/library_html5video.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ var LibraryHTML5Video = {
149149
GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_WRAP_S, GLctx.CLAMP_TO_EDGE);
150150
GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_WRAP_T, GLctx.CLAMP_TO_EDGE);
151151
VIDEO.player[player_id].textureId = texId;
152+
153+
if (typeof VIDEO.player[player_id].audioTracks == "undefined") {
154+
VIDEO.player[player_id].muted = true;
155+
}
152156

153157
// Check the file size
154158
//console.log('File size:' + fileSizeInBytes);
@@ -255,6 +259,11 @@ var LibraryHTML5Video = {
255259

256260
html5video_player_set_volume: function(player_id, volume) {
257261
VIDEO.player[player_id].volume = volume;
262+
if( volume <= 0 ){
263+
VIDEO.player[player_id].muted = true;
264+
}else{
265+
VIDEO.player[player_id].muted = false;
266+
}
258267
},
259268

260269
html5video_player_set_loop: function(player_id, loop) {
-4.37 MB
Binary file not shown.
Binary file not shown.

examples/computer_vision/opencvPeopleDetection/src/ofApp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void ofApp::setup(){
1212

1313
colorImg.allocate(vidGrabber.getWidth(),vidGrabber.getHeight());
1414
}else{
15-
vidPlayer.load("people.mov");
15+
vidPlayer.load("people.mp4");
1616
vidPlayer.play();
1717
vidPlayer.setLoopState(OF_LOOP_NORMAL);
1818

0 commit comments

Comments
 (0)