-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
audit = false | ||
fund = false | ||
save-exact = true | ||
save-prefix = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { LitElement, html, css } from 'lit' | ||
|
||
/** | ||
* Block Media Player | ||
*/ | ||
export class BlockMediaPlayerElement extends LitElement { | ||
static get styles() { | ||
return css` | ||
:host { | ||
display: block; | ||
} | ||
.container { | ||
overflow: hidden; | ||
border-radius: 5px; | ||
position: relative; | ||
} | ||
` | ||
} | ||
|
||
static get properties() { | ||
return { | ||
/** | ||
* Source URL | ||
* @type {string} | ||
*/ | ||
src: { type: String }, | ||
|
||
// Internal Properties | ||
// _loading: { state: true } | ||
} | ||
} | ||
|
||
constructor() { | ||
super() | ||
} | ||
|
||
async connectedCallback() { | ||
super.connectedCallback() | ||
} | ||
|
||
// get _video() { | ||
// return this.renderRoot?.querySelector('.video-display') ?? null | ||
// } | ||
|
||
// _playPause () { | ||
// if (this._video.paused) { | ||
// this._video.play() | ||
// } else { | ||
// this._video.pause() | ||
// } | ||
// } | ||
|
||
// _fullScreen () { | ||
// if (this._video.requestFullscreen) { | ||
// this._video.requestFullscreen() | ||
// } else if (this._video.webkitRequestFullscreen) { | ||
// this._video.webkitRequestFullscreen() | ||
// } | ||
// } | ||
|
||
render() { | ||
return html` | ||
<div class="container"> | ||
<video class="video-display" controls> | ||
<source src="${this.src}" type="video/mp4"> | ||
</video> | ||
</div> | ||
` | ||
} | ||
} | ||
|
||
window.customElements.define('block-media-player', BlockMediaPlayerElement) |