Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed prevew on mp4 resources #296

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading