simpler init, added fllback (classic)

This commit is contained in:
TreetopFlyer 2022-04-27 16:37:53 -04:00
parent eb5a1c189f
commit a62bf7ea4c
3 changed files with 33 additions and 5 deletions

27
app.classic.js Normal file
View File

@ -0,0 +1,27 @@
import 'https://js.boxcast.com/v3.min.js';
const Channels = {
Basics: "sfz7ja3rlpoous6usu8a",
Sunday: "gzahmhugrzogttfdtbjj",
Dev: "r3os2zfdnhlquhuypgtp"
};
const Player = boxcast("#boxcast");
Player.loadChannel(Channels.Basics,
{
showTitle: true,
showDescription: true,
showRelated: true,
showDocuments: true,
showIndex :true,
showDonations: false,
showCountdown: true,
relatedBroadcastsQuery:
{
s: "starts_at",
l: 100,
q: "timeframe:next starts_at:[2022-04-01T00:00:00 TO 2022-06-01T00:00:00]"
},
autoplay: true,
defaultVideo: "next",
});

7
app.js
View File

@ -424,5 +424,8 @@ const DateParse = (inDateString) =>
return obj; return obj;
}; };
/** @type {(inChannel:string, inSelector:string)=>void} */ /** @type {(inChannel:string, inSelector:string, inInterval:number)=>void} */
export default (inChannel, inSelector) => createRoot(document.querySelector(inSelector)).render(h(App, {channel:inChannel, interval:5000})); const Init = (inChannel, inSelector, inInterval) => createRoot(document.querySelector(inSelector)).render(h(App, {channel:inChannel, interval:inInterval}));
const Channel = { Basics: "sfz7ja3rlpoous6usu8a", Sunday: "gzahmhugrzogttfdtbjj", Dev: "r3os2zfdnhlquhuypgtp" };
Init(Channel.Basics, "#boxcast", 5000);

View File

@ -8,9 +8,7 @@
<div style="max-width:1100px; margin: 0 auto;"> <div style="max-width:1100px; margin: 0 auto;">
<div id="boxcast"></div> <div id="boxcast"></div>
<script type="module"> <script type="module">
import Init from "./app.js"; import "./app.js";
const Channel = { Basics: "sfz7ja3rlpoous6usu8a", Sunday: "gzahmhugrzogttfdtbjj", Dev: "r3os2zfdnhlquhuypgtp" };
Init(Channel.Basics, "#boxcast");
</script> </script>
</div> </div>