-
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.
Add start to playlist panel and some cleanup
- Loading branch information
Showing
7 changed files
with
124 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
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,12 +1,16 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import TopLevelInfo from './TopLevelInfo'; | ||
import ToolNavigator from './ToolNavigator'; | ||
import Divider from '@material-ui/core/Divider'; | ||
|
||
export default function PlayerPanel(props) { | ||
const { player } = props; | ||
|
||
return ( | ||
<div className="player-panel"> | ||
<TopLevelInfo player={player} /> | ||
<Divider /> | ||
<ToolNavigator player={player} /> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import Table from '@material-ui/core/Table'; | ||
import TableBody from '@material-ui/core/TableBody'; | ||
import TableCell from '@material-ui/core/TableCell'; | ||
import TableContainer from '@material-ui/core/TableContainer'; | ||
import TableRow from '@material-ui/core/TableRow'; | ||
import Paper from '@material-ui/core/Paper'; | ||
|
||
export default function PlaylistPanel(props) { | ||
const { playlist } = props; | ||
|
||
return ( | ||
<TableContainer component={Paper}> | ||
<Table size="small"> | ||
<TableBody> | ||
<TableRow> | ||
<TableCell>Bandwidth</TableCell> | ||
<TableCell align="right">{playlist.bandwidth}</TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableCell>Codecs</TableCell> | ||
<TableCell align="right">{playlist.codecs}</TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableCell>Width</TableCell> | ||
<TableCell align="right">{playlist.resolution.width || ''}</TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableCell>Height</TableCell> | ||
<TableCell align="right">{playlist.resolution.height || ''}</TableCell> | ||
</TableRow> | ||
</TableBody> | ||
</Table> | ||
</TableContainer> | ||
); | ||
} |
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,63 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import Tabs from '@material-ui/core/Tabs'; | ||
import Tab from '@material-ui/core/Tab'; | ||
import Box from '@material-ui/core/Box'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import PlaylistPanel from './PlaylistPanel'; | ||
|
||
function TabPanel(props) { | ||
const { children, selectedIndex, index, ...other } = props; | ||
|
||
return ( | ||
<div | ||
hidden={selectedIndex !== index} | ||
{...other} | ||
> | ||
{selectedIndex === index && ( | ||
<Box> | ||
{children} | ||
</Box> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
root: { | ||
backgroundColor: theme.palette.background.paper, | ||
}, | ||
tabs: { | ||
borderBottom: `1px solid ${theme.palette.divider}`, | ||
}, | ||
})); | ||
|
||
export default function ToolNavigator(props) { | ||
const { player } = props; | ||
const classes = useStyles(); | ||
const [selectedToolIndex, setSelectedToolIndex] = useState(0); | ||
|
||
const handleChange = (event, toolIndex) => { | ||
setSelectedToolIndex(toolIndex); | ||
}; | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<Tabs | ||
onChange={handleChange} | ||
value={selectedToolIndex} | ||
className={classes.tabs} | ||
> | ||
<Tab label="Segments" key={0} /> | ||
<Tab label="Playlist" key={1} /> | ||
</Tabs> | ||
<div> | ||
<TabPanel selectedIndex={selectedToolIndex} index={0}> | ||
<p>Segments</p> | ||
</TabPanel> | ||
<TabPanel selectedIndex={selectedToolIndex} index={1}> | ||
<PlaylistPanel playlist={player.selectedPlaylist} /> | ||
</TabPanel> | ||
</div> | ||
</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
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