resetVideo
The resetVideo() function resets the FacePop video player to the beginning (0:00 timestamp) without stopping playback.
Syntax
Answerly.FacePop.resetVideo();
This function takes no parameters and returns no value.
Description
The resetVideo() function resets the video player's playback position to the beginning (timestamp 0:00). Unlike completely stopping and restarting the video, this function allows you to quickly return to the start of the video while maintaining the current playback state.
When called, the function will:
- Set the current playback position to 0:00 (the beginning of the video)
- Maintain the current play/pause state (if the video was playing, it will continue playing from the beginning)
- Maintain the current audio state (muted/unmuted)
Example
Here's an example of how to use the resetVideo() function:
// Wait for the FacePop SDK to be loaded
window.addEventListener('FacePop:Loaded', function() {
// Create a button to reset the video
const resetButton = document.getElementById('reset-video-button');
// Add click event listener to the button
resetButton.addEventListener('click', function() {
// Reset the video to the beginning
Answerly.FacePop.resetVideo();
console.log('Video has been reset to the beginning');
});
});
In this example, clicking a button with the ID "reset-video-button" will reset the FacePop video to the beginning.
Use Cases
The resetVideo() function is particularly useful in the following scenarios:
- Tutorial or Demonstration Videos: Allow users to quickly restart a tutorial or demonstration without stopping the playback completely.
- Product Demonstrations: When showcasing a product, provide an easy way for users to view the demonstration from the beginning again.
- Interactive Marketing Videos: Allow users to restart marketing messages without interrupting their experience.
- Educational Content: Enable learners to review content from the beginning without needing to reload or reinitialize the player.
- User Engagement Features: Implement "watch again" functionality that resets the video without requiring additional user interaction.
Note
When using resetVideo(), be aware that any interactive elements or overlays that are triggered at specific timestamps will also be reset. If you have timed call-to-actions or forms, they will reappear according to their configured timing as the video plays from the beginning.