mute

How to mute/unmute audio when playing video using MPMoviePlayerController?

坚强是说给别人听的谎言 提交于 2019-11-27 04:26:02
问题 I've created my own custom controls for use with the MPMoviePlayerController . So far everything works except the mute button control. I've configured the AVAudioSession using the following code before I create my instance of the MPMoviePlayerController . NSError *modeError = nil; [self.audioSession setMode:AVAudioSessionModeMoviePlayback error:&modeError]; if (modeError != nil) { NSLog(@"Error setting mode for AVAudioSession: %@", modeError); } NSError *categoryError = nil; [self

Mute the global sound in Android

余生颓废 提交于 2019-11-27 04:14:33
Is there a method that can be used to mute the global sound from an application button? WitnessApplications They make it more complicated than it has to be. You can just use AudioManager.setStreamMute() . Feel free to use the code below. //mute audio AudioManager amanager=(AudioManager)getSystemService(Context.AUDIO_SERVICE); amanager.setStreamMute(AudioManager.STREAM_NOTIFICATION, true); amanager.setStreamMute(AudioManager.STREAM_ALARM, true); amanager.setStreamMute(AudioManager.STREAM_MUSIC, true); amanager.setStreamMute(AudioManager.STREAM_RING, true); amanager.setStreamMute(AudioManager

How to control Windows system volume using JScript or VBScript?

喜夏-厌秋 提交于 2019-11-26 23:04:11
问题 I want to control the volume of my Windows system from a JScript or VBScript script. Any ideas? Also, can I unmute the system volume if it is muted? 回答1: To mute or unmute the system volume, you can simulate the Mute key press using the WshShell.SendKeys method: var oShell = new ActiveXObject("WScript.Shell"); oShell.SendKeys(Chr(&HAD)); As for changing the volume level from a script, there's a solution that involves some Windows automation, such as launching the System Volume applet and

How to mute an html5 video player

谁都会走 提交于 2019-11-26 22:18:53
I've found how to pause and play the video using jquery $("video").get(0).play(); $("video").get(0).pause(); But I can't find the mute button, if there isn't a jquery solution, I'm fine with just an onclick js solution. I need it asap. Also is there a way to fix the mute delay? I want it to mute/unmute the sound as soon as the button is clicked. $("video").prop('muted', true); //mute AND $("video").prop('muted', false); //unmute See all events here (side note: use attr if in jQuery < 1.6) If you don't want to jQuery, here's the vanilla JavaScript: ///Mute var video = document.getElementById(

How to mute all sound in a page with JS?

放肆的年华 提交于 2019-11-26 20:54:47
How can I mute all sound on my page with JS? This should mute HTML5 <audio> and <video> tags along with Flash and friends. Rule #1: Never enable audio autoplay upon page loading. Anyway I'll show for HTML5 using jQuery: // WARNING: Untested code ;) window.my_mute = false; $('#my_mute_button').bind('click', function(){ $('audio,video').each(function(){ if (!my_mute ) { if( !$(this).paused ) { $(this).data('muted',true); //Store elements muted by the button. $(this).pause(); // or .muted=true to keep playing muted } } else { if( $(this).data('muted') ) { $(this).data('muted',false); $(this).play

Android mute/unmute phone

本秂侑毒 提交于 2019-11-26 19:52:10
问题 My goal is to support 2 operations: mute phone (possibly with vibrations enabled/disabled), so when a call or sms is received it won't make noise unmute phone and restore the volume to the state before muting phone How can I do this? What permissions are required in AndroidManifest? 回答1: This is the permission for vibrate into the manifest file <uses-permission android:name="android.permission.VIBRATE" /> this is for to put the device in silent mode with vibrate AudioManager audioManager =

Mute/Silence an iOS device programmatically?

陌路散爱 提交于 2019-11-26 12:48:03
问题 I\'m trying to mute the device\'s ringer from within my app, but for some reason using AVSystemController like in this answer ( How to disable iOS System Sounds ) won\'t let me silence the device ALL the way down.. it drops it to a volume of 1 bar, but not completely silent. I know it can be done, probably with a private API like AVSystemController, and I know that Apple will still approve the app if the user expects this kind of functionality from the app (since there are already 2 apps I

How to mute all sound in a page with JS?

三世轮回 提交于 2019-11-26 07:46:29
问题 How can I mute all sound on my page with JS? This should mute HTML5 <audio> and <video> tags along with Flash and friends. 回答1: Rule #1: Never enable audio autoplay upon page loading. Anyway I'll show for HTML5 using jQuery: // WARNING: Untested code ;) window.my_mute = false; $('#my_mute_button').bind('click', function(){ $('audio,video').each(function(){ if (!my_mute ) { if( !$(this).paused ) { $(this).data('muted',true); //Store elements muted by the button. $(this).pause(); // or .muted