Skip to content

Commit

Permalink
Fixed prevew on mp4 resources
Browse files Browse the repository at this point in the history
  • Loading branch information
jzongker committed Aug 15, 2023
1 parent 16c0e5e commit da2f645
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/appBase
10 changes: 9 additions & 1 deletion src/components/ImageModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ interface Props {
export const ImageModal: React.FC<Props> = (props: Props) => {


const getImageElement = () => <Image src={props.url} alt="lesson slide" width={1280} height={720} className="img-fluid" />
const getImageElement = () => {
let result = <Image src={props.url} alt="lesson slide" width={1280} height={720} className="img-fluid" />
if (props.url.indexOf(".mp4")>-1 || props.url.indexOf(".webm")>-1) {

result = <div style={{textAlign:"center"}}><video src={props.url || ""} style={{ width:"75vw", height: "75vh" }} autoPlay={true} /></div>
}
return result;
}


return (<>
<Dialog open={true} onClose={props.onClose} fullScreen={true}>
Expand Down

0 comments on commit da2f645

Please sign in to comment.