Skip to content

Commit

Permalink
Fix audio artifact component
Browse files Browse the repository at this point in the history
  • Loading branch information
contramundum53 committed Nov 13, 2023
1 parent 7f5d3fd commit fba9cf1
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions optuna_dashboard/ts/components/ArtifactCardMedia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
isThreejsArtifact,
} from "./ThreejsArtifactViewer"
import InsertDriveFileIcon from "@mui/icons-material/InsertDriveFile"
import { CardMedia } from "@mui/material"
import { CardMedia, Box } from "@mui/material"

export const ArtifactCardMedia: FC<{
artifact: Artifact
Expand Down Expand Up @@ -35,9 +35,18 @@ export const ArtifactCardMedia: FC<{
)
} else if (artifact.mimetype.startsWith("audio")) {
return (
<audio controls>
<source src={urlPath} type={artifact.mimetype} />
</audio>
<Box
style={{
width: "100%",
height: height,
display: "flex",
alignItems: "center",
}}
>
<audio controls style={{ width: "100%" }}>
<source src={urlPath} type={artifact.mimetype} />
</audio>
</Box>
)
} else if (artifact.mimetype.startsWith("image")) {
return (
Expand Down

0 comments on commit fba9cf1

Please sign in to comment.