2019-10-09 01:42:40 +00:00
|
|
|
import { construct_public_api } from "../../js-src/public-api";
|
2019-10-06 16:29:15 +00:00
|
|
|
import { get_config_options } from "../../js-src/config";
|
2019-09-05 02:11:01 +00:00
|
|
|
|
2019-09-05 19:05:22 +00:00
|
|
|
let html = document.getElementsByTagName("html")[0];
|
|
|
|
let page_options = get_config_options(html);
|
2019-10-08 01:25:17 +00:00
|
|
|
|
|
|
|
window.RufflePlayer = window.RufflePlayer || {};
|
2019-10-09 01:42:40 +00:00
|
|
|
window.RufflePlayer.local = construct_public_api();
|
2019-10-08 01:25:17 +00:00
|
|
|
|
|
|
|
//TODO: proper version negotiation
|
|
|
|
if (window.RufflePlayer.init === undefined) {
|
|
|
|
window.RufflePlayer.init = window.RufflePlayer.local.init;
|
|
|
|
}
|
|
|
|
|
|
|
|
//This is intended for sites that don't configure Ruffle themselves.
|
|
|
|
//If the page calls Ruffle before DOMContentLoaded, then we hold off on the
|
|
|
|
//standard set of interdictions.
|
|
|
|
window.addEventListener("DOMContentLoaded", function () {
|
|
|
|
if (!window.RufflePlayer.invoked) {
|
|
|
|
window.RufflePlayer.init(["plugin-detect", "static-content"]);
|
|
|
|
}
|
|
|
|
})
|