MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / pause

Function pause

Ports/JavaScriptPort/src/main/webapp/js/fontmetrics.js:2530–2582  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2528
2529
2530 function pause() {
2531 console.log("In pause()", stream);
2532 paused = true;
2533 recording = false;
2534 if (healthCheckHandle) {
2535 clearInterval(healthCheckHandle);
2536 healthCheckHandle = null;
2537 }
2538 if (stream) {
2539 stream.getTracks().forEach(function(track) {
2540 console.log("Disabling track", track);
2541 track.enabled = false;
2542 });
2543
2544 if (audioInput) {
2545 audioInput.disconnect();
2546 audioInput = null;
2547 }
2548 if (audioNode) {
2549
2550 audioNode.disconnect();
2551 audioNode = null;
2552 }
2553
2554 if (audioCtx) {
2555
2556 var thisCtx = audioCtx;
2557 audioCtx.close().then(function() {
2558 //console.log("Finished closing context ", thisCtx);
2559 });
2560 audioCtx = null;
2561 }
2562
2563
2564 if (isSafari || (isIOS() && !isIPad())) {
2565 if (stream) {
2566 stream.getTracks().forEach(function(track) {
2567 //console.log("Stopping track", track);
2568 track.stop();
2569 });
2570 if (stream.close) {
2571 stream.close();
2572 }
2573 if (stream.stop) {
2574 stream.stop();
2575 }
2576 stream = null;
2577 }
2578 }
2579 }
2580
2581
2582 }
2583
2584 function setupAudioProcessing(audioNode, audioCtx, notAllowedCallback, blockRecordCallback) {
2585 var pipe = {success:false};

Callers 4

stopFunction · 0.85
setupAudioProcessingFunction · 0.85
naCallbackFunction · 0.85
onStreamFunction · 0.85

Calls 9

isIOSFunction · 0.85
isIPadFunction · 0.85
logMethod · 0.65
forEachMethod · 0.65
disconnectMethod · 0.65
thenMethod · 0.65
closeMethod · 0.65
stopMethod · 0.65
pauseMethod · 0.65

Tested by

no test coverage detected