Javascript Events

Voxpopme Help Team UK -

There are a number of PostMessages that are fired throughout the non-panel video process ( These will work in all modern browsers.

Each event will include the following data:

Event Data

var returnData = {event:"EVENT_NAME"};
parent.postMessage(returnData, '*');

Events can be listened to with the following code:

Event listening

//this code is used to listen for events from the iframe
        var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
        var eventer = window[eventMethod];
        var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";

        // Listen to message from child window (iframe)

        var onlyStrings = false;
        try {
            window.postMessage({toString: function () {
                onlyStrings = true;
            }}, "*");
        } catch (e) {

        eventer(messageEvent, function (e) {
            if ( {
                var eventData = {};
                if (typeof === 'string' && onlyStrings) {
                    eventData = JSON.parse(;
                else {
                    eventData =
                if ("EVENT_NAME" == eventData.event) {
                    //add your code for the specified event
        }, false);


The following PostMessages will be sent:


 Initialized and is ready for use


Connection to our streaming server was lost.


Detecting active webcam


Web camera found


Error state when no camera is found


Microphone found


Unable to find a microphone


Camera access denied by user


Camera and Mic found and configured properly


Recording started


Recording stopped


Recording has been cancelled


Playback of recorded video has begun


Playback paused


The video has begun publishing to the VoxPopMe server


The video has finished publishing to the VoxPopMe server


The video failed to publish


The video has finished processing and uploading

`response_complete` (final stage)

This message will be sent when the video has been uploaded and saved successfully to the VoxPopMe platform.


This tracking event can be used to detect the user clicking the continue button. 


This message will appear if the campaign has completed because it has hit the number of responses specified.


This message will appear if the campaign is not currently active, i.e in draft, pending, scheduled, or has completed to due expiring. 

Have more questions? Submit a request


Article is closed for comments.