-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from eric2788/develop
v2.0.2 - second update
- Loading branch information
Showing
60 changed files
with
1,692 additions
and
422 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
|
||
function invokeLivePlayer(name: string, ...args: any[]): any { | ||
const self = window as any | ||
if (!self.$P2PLivePlayer) { | ||
console.warn('P2PLivePlayer not found') | ||
return undefined | ||
} | ||
return self.$P2PLivePlayer[name](...args) | ||
} | ||
|
||
|
||
export default invokeLivePlayer |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import type { ProgressEvent } from "@ffmpeg/ffmpeg/dist/esm/types" | ||
import { Spinner, Progress } from "@material-tailwind/react" | ||
import { useState } from "react" | ||
import TailwindScope from "~components/TailwindScope" | ||
import type { FFMpegHooks } from "~hooks/ffmpeg" | ||
import { useAsyncEffect } from "~hooks/life-cycle" | ||
|
||
|
||
function ProgressText({ ffmpeg }: { ffmpeg: Promise<FFMpegHooks> }) { | ||
|
||
const [progress, setProgress] = useState<ProgressEvent>(null) | ||
|
||
useAsyncEffect( | ||
async () => { | ||
const ff = await ffmpeg | ||
ff.onProgress(setProgress) | ||
}, | ||
async () => { }, | ||
(err) => { | ||
console.error('unexpected: ', err) | ||
}, | ||
[ffmpeg]) | ||
|
||
if (!progress) { | ||
return `编译视频中...` | ||
} | ||
|
||
const progressValid = progress.progress > 0 && progress.progress <= 1 | ||
|
||
return ( | ||
<TailwindScope> | ||
<div className="flex justify-center flex-col space-y-2"> | ||
<div className="flex flex-row items-center space-x-2"> | ||
<div> | ||
<Spinner className="h-5 w-5" /> | ||
</div> | ||
<div> | ||
{`编译视频中... ${progressValid ? `(${Math.round(progress.progress * 10000) / 100}%)` : ''}`} | ||
</div> | ||
</div> | ||
{progressValid && <Progress color="blue" value={progress.progress * 100} />} | ||
</div> | ||
</TailwindScope> | ||
) | ||
|
||
} | ||
|
||
export default ProgressText |
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.