MCPcopy Create free account
hub / github.com/ActiveState/code / volume_set

Function volume_set

recipes/JavaScript/578517_Music_player/recipe-578517.js:1372–1391  ·  view source on GitHub ↗
(i_dir)

Source from the content-addressed store, hash-verified

1370}
1371
1372function volume_set(i_dir)
1373{
1374 var em=document.getElementById("embplay");
1375 var n=0;
1376 try {n=parseInt(em.Settings.volume);} catch(err) { return; }
1377 if (i_dir<0)
1378 {
1379 n-=5;
1380 }
1381 if (i_dir>0)
1382 {
1383 n+=5;
1384 }
1385 if (n<0) n=0;
1386 if (n>100) n=100;
1387 em.Settings.volume=n;
1388 var ev=document.getElementById("volvalue");
1389 var sv=volume_value(n);
1390 ev.innerHTML=""+n+"%";
1391}
1392
1393function volume_up()
1394{

Callers 1

do_all_initFunction · 0.85

Calls 1

volume_valueFunction · 0.85

Tested by

no test coverage detected