Skip to content

Commit 1782e8a

Browse files
committed
fix webcomponent name
1 parent 8b23c5b commit 1782e8a

File tree

2 files changed

+29
-33
lines changed

2 files changed

+29
-33
lines changed

js/hang-demo/src/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
TODO: There's a bug with Big Buck Bunny causing audio to stutter, so we need to increase the latency to 100ms.
2828
2929
-->
30-
<hang-publish-ui>
31-
<hang-watch url="%VITE_RELAY_URL%" path="bbb" muted controls>
30+
<hang-watch-ui>
31+
<hang-watch url="%VITE_RELAY_URL%" path="bbb" muted>
3232
<canvas style="width: 100%; height: auto; border-radius: 4px; margin: 0 auto;"></canvas>
3333
</hang-watch>
34-
</hang-publish-ui>
34+
</hang-watch-ui>
3535

3636
<h3>Other demos:</h3>
3737
<ul>
Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
1-
import type HangWatch from '@kixelated/hang/watch/element';
2-
import { customElement } from 'solid-element';
3-
import { createSignal, onMount } from 'solid-js';
4-
import BufferingIndicator from './BufferingIndicator';
5-
import styles from './styles.css';
6-
import WatchControls from './WatchControls';
7-
import WatchControlsContextProvider from './WatchControlsContextProvider';
1+
import type HangWatch from "@kixelated/hang/watch/element";
2+
import { customElement } from "solid-element";
3+
import { createSignal, onMount } from "solid-js";
4+
import BufferingIndicator from "./BufferingIndicator";
5+
import styles from "./styles.css";
6+
import WatchControls from "./WatchControls";
7+
import WatchControlsContextProvider from "./WatchControlsContextProvider";
88

9-
customElement(
10-
'hang-publish-ui',
11-
{},
12-
function PublishControlsWebComponent(_, { element }) {
13-
const [hangWatchhEl, setHangWatchEl] = createSignal<HangWatch>();
9+
customElement("hang-watch-ui", {}, function PublishControlsWebComponent(_, { element }) {
10+
const [hangWatchhEl, setHangWatchEl] = createSignal<HangWatch>();
1411

15-
onMount(() => {
16-
const watchEl = element.querySelector('hang-watch');
12+
onMount(() => {
13+
const watchEl = element.querySelector("hang-watch");
1714

18-
if (watchEl) {
19-
setHangWatchEl(watchEl);
20-
}
21-
});
15+
if (watchEl) {
16+
setHangWatchEl(watchEl);
17+
}
18+
});
2219

23-
return (
24-
<WatchControlsContextProvider hangWatch={hangWatchhEl}>
25-
<style>{styles}</style>
26-
<div class="watchVideoContainer">
27-
<slot />
28-
<BufferingIndicator />
29-
</div>
30-
<WatchControls />
31-
</WatchControlsContextProvider>
32-
);
33-
}
34-
);
20+
return (
21+
<WatchControlsContextProvider hangWatch={hangWatchhEl}>
22+
<style>{styles}</style>
23+
<div class="watchVideoContainer">
24+
<slot />
25+
<BufferingIndicator />
26+
</div>
27+
<WatchControls />
28+
</WatchControlsContextProvider>
29+
);
30+
});

0 commit comments

Comments
 (0)