Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
fix: update super-media-element
Browse files Browse the repository at this point in the history
  • Loading branch information
luwes committed Apr 8, 2023
1 parent b5448ef commit 59df0f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ <h1>&lt;wistia-video&gt;</h1>

<wistia-video
controls
src="https://wesleyluyten.wistia.com/medias/oifkgmxnkb"
loop
muted
style="position:relative;"
Expand All @@ -55,12 +54,17 @@ <h1>&lt;wistia-video&gt;</h1>
</div>
</wistia-video>

<script>
let video = document.querySelector('wistia-video');
video.src = "https://wesleyluyten.wistia.com/medias/oifkgmxnkb";
</script>

<br>

<button id="loadbtn">Load new clip</button>

<script>
const video = document.querySelector('wistia-video');
video = document.querySelector('wistia-video');

loadbtn.onclick = () => {
video.src = 'https://wesleyluyten.wistia.com/medias/1ekn652fs5';
Expand Down Expand Up @@ -148,3 +152,4 @@ <h2>With <a href="https://github.com/muxinc/media-chrome" target="_blank">Media
<media-fullscreen-button></media-fullscreen-button>
</media-control-bar>
</media-controller>

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"scripts": {
"lint": "npx eslint *.js",
"test": "wet run",
"dev": "wet serve"
"dev": "wet serve --cors"
},
"dependencies": {
"super-media-element": "1.1.1"
"super-media-element": "1.1.2"
},
"devDependencies": {
"wet-run": "^0.0.7"
Expand Down
2 changes: 1 addition & 1 deletion wistia-video-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class WistiaVideoElement extends SuperVideoElement {
static skipAttributes = ['src'];

get nativeEl() {
return this.api?.elem();
return this.api?.elem() ?? this.querySelector('video');
}

async load() {
Expand Down

1 comment on commit 59df0f9

@vercel
Copy link

@vercel vercel bot commented on 59df0f9 Apr 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wistia-video-element – ./

wistia-video-element.vercel.app
wistia-video-element-git-main-luwes.vercel.app
wistia-video-element-luwes.vercel.app

Please sign in to comment.