-
Notifications
You must be signed in to change notification settings - Fork 1
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
a9433ee
commit c338ded
Showing
22 changed files
with
203 additions
and
67 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
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
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
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
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
7 changes: 7 additions & 0 deletions
7
libs/media/src/lib/components/video-player/video-player.component.html
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,7 @@ | ||
<video | ||
#player | ||
controls | ||
crossorigin="anonymous" | ||
[src]="storagePath | videoUrl" | ||
autoplay | ||
></video> |
4 changes: 4 additions & 0 deletions
4
libs/media/src/lib/components/video-player/video-player.component.scss
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 @@ | ||
video { | ||
width: 100%; | ||
max-width: 1500px; | ||
} |
38 changes: 38 additions & 0 deletions
38
libs/media/src/lib/components/video-player/video-player.component.ts
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,38 @@ | ||
import { AfterViewInit, Component, ElementRef, Input, ViewChild, ViewEncapsulation } from '@angular/core' | ||
import { MediaRefPipe, VideoUrlPipe } from '@strive/media/pipes/media.pipe'; | ||
// import Hls from 'hls.js' | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'media-video-player', | ||
templateUrl: './video-player.component.html', | ||
styleUrls: ['./video-player.component.scss'], | ||
encapsulation: ViewEncapsulation.None, | ||
imports: [ | ||
MediaRefPipe, | ||
VideoUrlPipe | ||
] | ||
}) | ||
export class VideoPlayerComponent implements AfterViewInit { | ||
@ViewChild('player', { static: true }) player: ElementRef<HTMLVideoElement> = {} as ElementRef<HTMLVideoElement>; | ||
|
||
@Input() storagePath = '' | ||
|
||
ngAfterViewInit() { | ||
// Vidoe API only available on IMGIX enterprice plan: https://www.imgix.com/pricing | ||
// if (!this.storagePath) return | ||
|
||
// const video = this.player.nativeElement | ||
// const src = `https://${environment.firebase.options.projectId}.imgix.video/${encodeURI(this.storagePath)}?fm=hls` | ||
|
||
// if (video.canPlayType('application/vnd.apple.mpegurl')) { | ||
// video.src = src | ||
// } else if (Hls.isSupported()) { | ||
// const hls = new Hls() | ||
// hls.loadSource(src) | ||
// hls.attachMedia(video) | ||
// } else { | ||
// console.error("This is a legacy browser that doesn't support Media Source Extensions") | ||
// } | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.