| author | veltr |
| Thu, 03 May 2012 17:52:52 +0200 | |
| branch | new-model |
| changeset 882 | 61c384dda19e |
| parent 809 | 1997dae651c6 |
| child 906 | 4b6e154ae8de |
| permissions | -rw-r--r-- |
| 589 | 1 |
/* This piece of code is directly requested by the page the player is embedded |
2 |
on. It creates the iframe the player is embedded in and it reflects changes |
|
3 |
to the iframe url in the page url. |
|
4 |
*/ |
|
5 |
||
| 882 | 6 |
(function(_frameId) { |
7 |
var _frame = document.getElementById(_frameId); |
|
8 |
|
|
9 |
window.onhashchange = function() { |
|
10 |
frame.contentWindow.postMessage({type: "hashchange", hash: hashvalue}, "*"); |
|
11 |
}; |
|
|
809
1997dae651c6
added some code to handle embedding in an iframe and mediafragment.
hamidouk
parents:
589
diff
changeset
|
12 |
|
| 882 | 13 |
window.addEventListener('message', function(_e) { |
14 |
if (e.data.type === "hashchange") { |
|
15 |
document.location.hash = e.data.hash; |
|
|
809
1997dae651c6
added some code to handle embedding in an iframe and mediafragment.
hamidouk
parents:
589
diff
changeset
|
16 |
} |
| 882 | 17 |
}); |
18 |
|
|
19 |
})("metadataplayer_embed"); |