Documentation Menu

unmute

The unmute() function restores audio to the FacePop video player if it's currently muted.

Description

This function enables audio playback for the FacePop video player. If the video is already unmuted, calling this function has no effect. This is useful for situations where you want to ensure that users can hear the audio content after it has been previously muted.

When called, the function will:

  • Enable audio for the currently playing video
  • Update the mute/unmute button state in the player interface if visible
  • Trigger the appropriate event listeners

Syntax

Answerly.FacePop.unmute();

Parameters

This function does not accept any parameters.

Return Value

This function does not return a value.

Example

// Ensure the FacePop SDK is loaded
window.addEventListener('FacePop:Loaded', function() {
  // Unmute the video player
  Answerly.FacePop.unmute();
  
  console.log('Video audio has been enabled');
});

Common Use Cases

  • Enabling audio after a user interacts with the page (addressing autoplay restrictions)
  • Restoring audio after temporarily muting for another media element on the page
  • Implementing custom mute/unmute controls outside the FacePop player
  • Ensuring audio is enabled at specific points in your application flow

Notes

  • This function is the counterpart to the mute() function.
  • Due to browser autoplay policies, videos may start muted by default. You may need to call unmute() after a user interaction to enable audio.
  • Calling unmute() on an already unmuted video will have no effect.
  • The function will trigger a FacePop:Unmute event that you can listen for.