embedly/player.js — pull request #9 by jhorman (2014-04-25 01:03:34+00:00)
Title: Adds a context to all JSON postmessage data

Without some sort of name spacing it is very easy for there to be a conflict between various postMessage messages flying around. We experienced a problem with a Vimeo `ready` message being read by `player.js` and throwing an exception. Specifically in

```javascript
if (data.event === 'ready' && data.value.src === this.elem.src){
this.ready(data);
}
````

Vimeo was firing a `ready` event, but there was no `data.value` and so an exception was thrown.

I am sort of hoping all frameworks using postMessage start name spacing in this way to avoid stepping on each other.

I am unclear on whether player.js implementors are dealing with postMessage messages directly, or always using this library. If receivers are dealing with the messages directly this change shouldn't affect them since the only new piece of data is "context". For message publishers, if they are publishing without this context, but the reciever is expecting context, there will be a migration issue.