Extend iframe message API #3100

Open
opened 2018-03-05 08:42:48 +00:00 by sanj · 1 comment

Currently, there are a few ways to communicate between a parent page and an iframe embed. This ticket is an attempt to start documenting all the current possibilities of message passing, as well as make feature requests for more events and messages to be exposed via the embed API.

Current message API:

Messages that can be sent from parent to iframe:

  • setUrl: update the URL hash of the iframe, manipulating the state.

Events sent from iframe back to parent window:

  • For Player Embed:
    • loaded: when player has been loaded
    • closed: when player has been closed

^^ TODO: more detailed docs and examples

Some brain-dump of further use-cases:

I want to be able to update / set the time-code of the video in the iframe via the parent. This may already possible using setUrl. Needs example.

I want to be able to subscribe to timecode position updates within the iframe from the parent. This would require adding "position" or so to the list of events passed from iframe to parent.

... TODO: add further use-cases, also covering more embed types than simple video.

Currently, there are a few ways to communicate between a parent page and an iframe embed. This ticket is an attempt to start documenting all the current possibilities of message passing, as well as make feature requests for more events and messages to be exposed via the embed API. Current message API: Messages that can be sent from parent to iframe: - setUrl: update the URL hash of the iframe, manipulating the state. Events sent from iframe back to parent window: - For Player Embed: - loaded: when player has been loaded - closed: when player has been closed ^^ TODO: more detailed docs and examples Some brain-dump of further use-cases: I want to be able to update / set the time-code of the video in the iframe via the parent. This may already possible using setUrl. Needs example. I want to be able to subscribe to timecode position updates within the iframe from the parent. This would require adding "position" or so to the list of events passed from iframe to parent. ... TODO: add further use-cases, also covering more embed types than simple video.
sanj added the
frontend
label 2018-03-05 08:42:48 +00:00
sanj added this to the 15.04 milestone 2018-03-05 08:42:48 +00:00
0x2620 was assigned by sanj 2018-03-05 08:42:48 +00:00
sanj added the
normal
enhancement
labels 2018-03-05 08:42:48 +00:00
Author

Created a repository with a basic example of sending and receiving messages to a pad.ma embed iframe:
https://code.with.camp/sanj/padmaEmbeds

Can see it: https://dataliberationfront.in/padmaEmbeds

Created a repository with a basic example of sending and receiving messages to a pad.ma embed iframe: <https://code.with.camp/sanj/padmaEmbeds> Can see it: <https://dataliberationfront.in/padmaEmbeds>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: 0x2620/pandora#3100
No description provided.