| @@ -4,20 +4,20 @@ | ||
| 4 | 4 | <head> |
| 5 | 5 | <meta charset="UTF-8"> |
| 6 | 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 7 | 7 | <title>Document</title> |
| 8 | - <script src="https://hosted.muses.org/mrp.js"></script> | |
| 8 | + <script src="./assets/vendor/muses-player/mrp.js"></script> | |
| 9 | 9 | <script> |
| 10 | 10 | function getQueryParam(param) { |
| 11 | 11 | const urlParams = new URLSearchParams(window.location.search); |
| 12 | 12 | return urlParams.get(param); |
| 13 | 13 | } |
| 14 | - const playerData = window.top[getQueryParam("id")]; | |
| 14 | + let playerData = null; | |
| 15 | + if (window.top && window.top.location.origin === window.location.origin) { | |
| 16 | + playerData = window.top[getQueryParam("id")]; | |
| 17 | + } | |
| 15 | 18 | </script> |
| 16 | 19 | <style> |
| 17 | - /* #MusesRadioPlayer-HTML5-player-0 { | |
| 18 | - margin: auto; | |
| 19 | - } */ | |
| 20 | 20 | body { |
| 21 | 21 | margin: 0; |
| 22 | 22 | width: inherit; |
| 23 | 23 | overflow: hidden; |
| @@ -26,11 +26,15 @@ | ||
| 26 | 26 | </head> |
| 27 | 27 | |
| 28 | 28 | <body> |
| 29 | 29 | <script type="text/javascript"> |
| 30 | - MRP.insert(playerData) | |
| 31 | - MRP.setTitle(playerData.title); | |
| 32 | - window.top[getQueryParam("id")] = null; | |
| 30 | + if (playerData) { | |
| 31 | + window.MRP?.insert(playerData) | |
| 32 | + window.MRP?.setTitle(playerData.title); | |
| 33 | + if (window.top && window.top.location.origin === window.location.origin) { | |
| 34 | + window.top[getQueryParam("id")] = null; | |
| 35 | + } | |
| 36 | + } | |
| 33 | 37 | </script> |
| 34 | 38 | </body> |
| 35 | 39 | |
| 36 | 40 | </html> |