Frontend and Application Communication
Learn how to integrate the Streampixel iframe into your frontend, manage keyboard and mouse inputs, and ensure smooth interaction.
Overview
Listening for Messages
window.addEventListener('message', (event) => {
// Validate the message source for security
if (event.origin === 'https://share.streampixel.io') {
console.log('Message received:', event.data);
// Example: Handle stream-state updates
if (event.data.type === 'stream-state') {
console.log('Stream state:', event.data.value); // e.g., 'loadingComplete'
}
}
});Sending Messages
Security Best Practices
Last updated