WebRTC - enable sound in chrome doesn't work - google-chrome

I need to create mute/unmute sound in my app using WebRTC.
I created a function:
this.StreamSound = function(aStream)
{
mStream.getAudioTracks()[0].enabled = aStream
}
It works in FF but in chrome don't (aStream == false) :/
Any idea?
(I'm testing it by local "video" tag)

For a local stream, to mute on a local video, you should set the 'muted' property on the local video tag.
If using jQuery the code will be:
$('#localvideo').prop('muted',true);
For muting audio that is being sent on the PeerConnection to a remote browser the audio tracks enabled should work in both Firefox and Chrome.

Related

HTML5 Without Https

I would like to have a file (ex. index.html) where i can use html5 for video.
I would like to access this file from my webbrowser locally. Without the need of a website.
I have tried using this on my pc locally, but it would not execute the html5.
I then have pushed it to my website which does have https:// and the videoplayer worked the way it was supposed to.
<video id="videoPlayer" src="a.mp3" autoplay autobuffer controls />
<script type="text/javascript">
var nextVideo = "b.mp3";
var videoPlayer = document.getElementById('videoPlayer');
videoPlayer.onended = function(){
videoPlayer.src = nextVideo;
}
</script>
This code will not have the html5 functions available.
I tried using this code with the chrome plugin pitch shifter without succes (local) while on my server it would work perfectly
I'd comment instead of answering but i am not allowed to.
The problem you encounter is not reproduceable in Chrome Version 61.0.3163.100 on Windows 10 - 64 bit. IE, edge, FF and chrome work with your code (but 2 mp4 files instead of your mp3's) locally for me.
What does the Console output of the F12 debug tools write when you attempt to load it locally?

Cache video on Samsung SmartTV

I'm have a webpage that is just a fullscreen video that I want to display on a Samsung PM32F SmartTv using the built in browser. If I have a internet connection this works fine but when I try to cache the video using a cache manifest to be able to show it offline the video will not play.
I have tried the same kind of caching with images and that works fine.
The video I'm trying to display is a mp4 file and is smaller then one of the images I have tried with so I don't think it's a size isue.
I do not have access to any kind of developer tools for the TV's browser so I can't check for any error messages.
The video is in a <video> tag.
Any kind of help would be much appriciated.
You could try the following script (I could not test it on real tv).
function handleVideo(stream) {
video.src = window.URL.createObjectURL(stream);
document.getElementById("videoElement").pause();
}
After some time I found out it was just a simple server issue with a file that had been moved.

Can't play mp4 from web-server, plays fine from file://

I've tried this running a few simple servers, beefy.js and static-server, both simple node servers.
My problem is that when I load my video via an http:// in a video element, or via a relative path on the local web-server, it doesn't play. I get no errors.
I've checked the address is correct by providing an incorrect address which gives me an error in the console.
If I give chrome a file://LOCATION_OF_MP4, chrome will play the video no problem.
If I go to http://localhost:9080/relative-location.MP4, I get a black screen with player controls and a muted sound.
I can't figure out why the local version should be fine, but the server-based can't be found.
I'm creating the video tag via
var vid = document.createElement('video');
console.log('src', state.demoVideo.store.src());
vid.setAttribute('src', state.demoVideo.store.src());
document.body.appendChild(vid);

Audio element not working properly with Safari

I can't seem to get the audio element to work properly in Safari (v 5.1.2). I've tried moving the file to the same folder as the page, using both mp3 and mpeg MIME types, and changing filenames. It seems to work fine in all other browsers, but in Safari the audio element is created, but only shows that it is loading and will not play. Any ideas?
<audio controls preload="metadata">
<source src="audio/song.mp3" type="audio/mpeg" />
<source src="audio/song.ogg" type="audio/ogg" />
</audio>
Thanks
Does your website use an invalid HTTPS certificate or a HTTP Auth? I had this issue but found that Safari was having issues with either my invalid HTTPS cert or the Basic Auth (on the staging server).
Safari does not seem to load sounds reliably with preload="metadata".
You can try this in the console, of any webpage really:
var snd = document.createElement('audio'), src = document.createElement('source');
src.src = "http://www.largesound.com/ashborytour/sound/brobob.mp3";
src.type = "audio/mpeg";
snd.appendChild(src);
snd.preload = 'metadata';
snd.play();
It doesn't work. Then:
snd.preload = null; // equivalent to 'auto'
And voilĂ ! It starts playing.
(I've filed this as rdar://problem/11481585, not that that helps any of us.)
Try installing apple quick time. I don't know about desktop versions but the IOS versions use quicktime to play sound from safari.
yes, an invalid HTTPS certificate or a HTTP Auth does not works on safari ( tested on customized safari browser on low end linux device ).
In order to make it work, please use valid https certificate.

Firefox not playing embedded swf

I am using swfin to embed a swf object (video player) and it loads fine in all browsers, but in firefox it won't "start". I have to right click on the movie area and "start" is unchecked so I click on "start" and it will start just fine. Yet, in chrome and IE (haven't moved to a mac for testing yet) it fires up and starts just as I expected. I have tried swfobject instead of swfin and I have IE issues that I couldn't seem to correct. Hence moving to swfin. I saw a similiar problem like this using swfobject but I can't get it to replicate anymore.
Here is the swfin code:
`
var s = new swfIN("/Flash/video_player_playhead_overlays.swf", "flashMovie", "427", "280");
// s.hideSEO("div_seo");
s.addVar("video_file", "/DownloadableWork/Boardwalk.flv");
s.addVar("poster_file", "/Images/UploadedImages/Boardwalk.jpg");
s.addVar("clock_display", "yes");
s.addVar("playbtn_scale", "1");
s.addParam("play", "true");
s.addParam("loop", "true");
s.addParam("quality", "high");
s.addParam("scale", "showall");
s.addParam("wmode", "transparent");
s.addParam("menu", "true");
s.addParam("allowScriptAccess", "sameDomain");
s.write();
</script>
`
It's probably related to the video player swf itself rather than the http browser.
I would strongly recommend using swfobject, it's widely accepted as the industry standard for embedding swf content.
http://blog.deconcept.com/swfobject/
SWFObject is also recommended by Adobe.
http://www.adobe.com/devnet/flashplayer/articles/swfobject.html