forked from blakewilson/vidbg
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
753a314
commit 29ba2e3
Showing
11 changed files
with
13,174 additions
and
47 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 |
---|---|---|
|
@@ -83,7 +83,4 @@ typings/ | |
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# Do not version dist | ||
dist | ||
|
||
.DS_Store |
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,13 @@ | ||
{ | ||
"name": "levmyshkin/vidbg", | ||
"description": "An HTML5 video player.", | ||
"type": "drupal-library", | ||
"keywords": [ | ||
"video background", | ||
"html5", | ||
"video", | ||
"player" | ||
], | ||
"homepage": "https://drupalbook.org/", | ||
"license": "MIT" | ||
} |
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,2 @@ | ||
import { VidbgAttributes } from "../types/types"; | ||
export declare const defaultAttributes: VidbgAttributes; |
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,2 @@ | ||
import { VidbgOptions } from "../types/types"; | ||
export declare const defaultOptions: VidbgOptions; |
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 @@ | ||
declare class InvalidSelectorError extends Error { | ||
constructor(message: string); | ||
} | ||
export default InvalidSelectorError; |
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 @@ | ||
declare class VideoSourceNotSpecifiedError extends Error { | ||
constructor(message: string); | ||
} | ||
export default VideoSourceNotSpecifiedError; |
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,14 @@ | ||
export interface VidbgOptions { | ||
mp4: string | null; | ||
webm: string | null; | ||
poster: string | null; | ||
overlay: boolean; | ||
overlayColor: string; | ||
overlayAlpha: number; | ||
} | ||
export interface VidbgAttributes { | ||
controls: boolean; | ||
loop: boolean; | ||
muted: boolean; | ||
playsInline: boolean; | ||
} |
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,26 @@ | ||
import { VidbgAttributes, VidbgOptions } from "./types/types"; | ||
declare class vidbg { | ||
el: HTMLElement; | ||
options: VidbgOptions; | ||
attributes: VidbgAttributes; | ||
containerEl: HTMLElement; | ||
overlayEl: HTMLElement; | ||
videoEl: HTMLVideoElement; | ||
constructor(selector: string, options?: VidbgOptions, attributes?: VidbgAttributes); | ||
private init; | ||
private createContainer; | ||
private createOverlay; | ||
private createPoster; | ||
private createVideo; | ||
private onPlayEvent; | ||
removeVideo: () => void; | ||
getVideo: () => HTMLVideoElement; | ||
getEl: () => HTMLElement; | ||
isVideoPlaying: () => boolean; | ||
playVideo: () => Promise<void>; | ||
pauseVideo: () => void; | ||
destroy: () => void; | ||
resize: () => void; | ||
} | ||
export { VidbgOptions, VidbgAttributes }; | ||
export default vidbg; |
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,31 @@ | ||
.vidbg-container { | ||
position: absolute; | ||
z-index: -1; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
overflow: hidden; | ||
background-size: cover; | ||
background-repeat: no-repeat; | ||
background-position: center center; | ||
} | ||
|
||
.vidbg-container video { | ||
position: absolute; | ||
margin: 0; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
transition: 0.25s opacity ease-in-out; | ||
max-width: none; | ||
opacity: 0; | ||
} | ||
|
||
.vidbg-overlay { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.