-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sample-app) Added video player to the sample app (#133)
- Loading branch information
1 parent
5421fad
commit e610a94
Showing
8 changed files
with
659 additions
and
4 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -1,3 +1,19 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.SceneViewer { | ||
position: relative; | ||
min-height: 680px; | ||
min-width: 1200px; | ||
resize: both; | ||
overflow: auto; | ||
} | ||
|
||
.VideoPlayerComponent { | ||
position: absolute; | ||
min-height: 680px; | ||
min-width: 1200px; | ||
resize: both; | ||
overflow: auto; | ||
} |
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
4 changes: 2 additions & 2 deletions
4
examples/react-app/src/SceneViewer.tsx → .../react-app/src/components/SceneViewer.tsx
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,20 @@ | ||
import React from 'react'; | ||
|
||
import { VideoPlayer } from '@iot-app-kit/react-components'; | ||
import { dataSource } from '../dataSource'; | ||
import { kvsStreamName, videoEntityId, videoComponentName, videoViewport } from '../configs'; | ||
|
||
const videoData = dataSource.videoData({ kvsStreamName: kvsStreamName, entityId: videoEntityId, componentName: videoComponentName }); | ||
|
||
const VideoPlayerComponent = () => { | ||
return ( | ||
<div className="VideoPlayerComponent" > | ||
<VideoPlayer | ||
videoData={videoData} | ||
viewport={videoViewport} | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
export default VideoPlayerComponent; |
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,33 @@ | ||
import React from "react"; | ||
import Paper from "@material-ui/core/Paper"; | ||
import Tab from "@material-ui/core/Tab"; | ||
import Tabs from "@material-ui/core/Tabs"; | ||
import SceneViewer from "./SceneViewer"; | ||
import VideoPlayerComponent from './VideoPlayer'; | ||
|
||
const ComponentsTab = () => { | ||
const [value, setValue] = React.useState(0); | ||
|
||
return ( | ||
<div> | ||
<h3>Sample IoT AppKit Components</h3> | ||
<Paper square> | ||
<Tabs | ||
value={value} | ||
textColor="primary" | ||
indicatorColor="primary" | ||
onChange={(event: any, newValue: React.SetStateAction<number>) => { | ||
setValue(newValue); | ||
}} | ||
> | ||
<Tab label="Scene Viewer" /> | ||
<Tab label="Video Player" /> | ||
</Tabs> | ||
{value === 0 && <SceneViewer />} | ||
{value === 1 && <div><VideoPlayerComponent /></div>} | ||
</Paper> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ComponentsTab; |
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