-
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.
feat: post ac video for problem spConfig
- Loading branch information
1 parent
fa0fee3
commit b748a3a
Showing
3 changed files
with
140 additions
and
6 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,45 @@ | ||
import React from 'react'; | ||
import ReactPlayer from 'react-player/file'; | ||
|
||
export interface AutoVideoScreenProps { | ||
url: string; | ||
allowSkip?: boolean; | ||
background?: string; | ||
onFinished?: () => any; | ||
onError?: (err: any, data?: any) => any; | ||
} | ||
|
||
interface State {} | ||
|
||
export default class AutoVideoScreen extends React.Component<AutoVideoScreenProps, State> { | ||
containerRef: HTMLElement | null; | ||
lastSceneRef: HTMLElement | null; | ||
|
||
constructor(props: AutoVideoScreenProps) { | ||
super(props); | ||
this.state = {}; | ||
} | ||
|
||
render() { | ||
return ( | ||
<div | ||
style={{ width: '100%', height: '100%', background: this.props.background }} | ||
ref={(ref) => { | ||
this.containerRef = ref; | ||
}} | ||
> | ||
<ReactPlayer | ||
url={this.props.url} | ||
playing | ||
onProgress={console.log} | ||
onError={this.props.onError} | ||
onEnded={this.props.onFinished} | ||
width="100%" | ||
height="100%" | ||
/> | ||
{/* TODO a skip button */} | ||
{/* TODO hide cursor */} | ||
</div> | ||
); | ||
} | ||
} |
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