Tokbox audioLevelUpdated event not working in firefox - tokbox

I'm experiencing an issue when trying to capture the audio levels from the Tokbox publisher. My code works perfectly on Chrome but are not working as expected on Firefox . I'm using
Here is my code:
this.publisher.on('audioLevelUpdated', (event) => {
console.log("event.audioLevel: " + event.audioLevel);

Related

WebRTC stop local tracks not disabling webcam after using replaceTrack

I try to stop the browser webcam permissions indicator by using track.stop() like this:
myLocalStream.getTracks().forEach(track => {
track.stop();
});
In most cases this works fine. But if during the session I have switched between different cameras by using replaceTrack() it will not work. The browser still shows a running webcam. The code for switching between tracks looks like this:
pc.getSenders().map(sender => {
sender.replaceTrack(myLocalStream.getTracks().find(t => t.kind == sender.track.kind), myLocalStream)
});
It looks like after replacing the tracks, the browser has still some references to running tracks, that I don't know how to stop. Any suggestions?

Safari not retrieving mp4 video from cache, and sometimes timeout when downloading the same resource

I'm running a VueJS application that displays a full screen story of videos. I don't create as many tag as number of media in my story : I'm just changing component video sources each time I play a new video.
But it looks like Safari (Desktop & mobile) still does not cache HTML video once loaded : when I'm playing again a previous media, Safari is downloading again the asset. Instead of getting from cache like Chrome does.
The same issue has already been reported here but sill no correct answer.
Safari even stops downloading the final bytes video (producing a sort of timeout) when we go back and forth quicky in the story, so the story looks stuck.
Here's an example link.
Does anyone know a good alternative that avoids re-downloading video data at each play on Safari ?
Partial solution
Found myself a workaround that works pretty well if video is small size - all video are less than 3Mb in my case.
The trick is to use js fetch API to download full video, then stream it into video tag.
const videoRequest = fetch("/path/to/video.mp4")
.then(response => response.blob());
videoRequest.then(blob => {
video.src = window.URL.createObjectURL(blob);
});
Contrary to video src attribute, fetch API will get video data from cache if the same video was already fetched before.
Here a codepen demo that can be tested in Safari desktop/mobile (when NOT in private mode).
Pro : Video are now pulled from cache in Safari !
Con : You can't start the video until full data has been downloaded. That's why this solution can be used only for small video (like < 5Mb), else your users may wait a while before being able to play the video.

Webrtc: cannot stop remoteStream audio

I am playing a remote webrtc stream.
When I run that:
remoteStream.getVideoTracks()[0].stop();
remoteStream.getAudioTracks()[0].stop();
Video stops but audio continues: any idea ?
ID.png
Working fine in Firefox, may be a bug in chrome.
After calling remoteStream.getAudioTracks()[0].stop();
Track readyState is changing from live to ended.
You can report # https://bugs.chromium.org/p/webrtc/issues/list
For time being you can set audio/video tag volume as follows
document.getElementById("remotevideo").volume = 0;

Battery API is not working on chrome pop up window

is there a way to get the Battery object in chrome pop up windows
I am using this code to create pop up
chrome.windows.create({'url': 'mypop.html', 'type': 'popup'}, function(window) {
});
but having problem to return the battery object using this code
var battery = navigator.webkitBattery;
when I am calling the javascript file on the mypop.html page.
Is it the chrome security issue that disallow battery object on pop up page?
Looks like its been removed from Chrome as navigator.webkitBattery is undefined
Chrome developer advocate has replied over here on SO.
Checkout this thread.
navigator.webkitBattery not working in Google chrome

jQuery Mobile disables Mobile Safari's AutoFill

this is specifically about MOBILE SAFARI. let's not discuss other browsers.
alright, i've got a form that works with Safari's AutoFill on the mac, it also works in a Mobile Safari if i remove jQuery Mobile. however, as soon I have jQuery Mobile firing, the AutoFill button/feature in mobile Safari stops responding. the "AutoFill" button is greyed out.
can anyone explain this?
thanks
** UPDATE / ~ANSWER **
jQuery Mobile [v1.0a4.1] just up and sets:
this.setAttribute("autocomplete", "off");
on
var textInputs = allControls.filter( "input[type=text]" );
...which makes all the difference.
see: https://github.com/jquery/jquery-mobile/issues/785
I believe I read that this was updated in version 1.1, and this was fixed.
If its not, there's no reason why you shouldn't be able to reset it where you need it, either on a per page basis, or globably ...
PER PAGE:
$(document).delegate('yourpage','pageinit',function(){
$(‘input[type=text]‘).attr(‘autocomplete’,'on’);
});
GLOBAL:
$(document).bind('mobileinit',function(){
$(‘input[type=text]‘).attr(‘autocomplete’,'on’);
})
autocomplete on fix came from http://ranservices.com/2011/11/jquery-mobile-breaks-autofill-on-iphone/