Skip to content

Commit

Permalink
fix(player): content resizes with window (#1142)
Browse files Browse the repository at this point in the history
  • Loading branch information
sr258 authored and JPSchellenberg committed Jan 11, 2021
1 parent 0ddff46 commit eb4e201
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"electron-notarize": "1.0.0",
"husky": "4.3.7",
"jest": "26.6.0",
"prettier": "^2.2.1",
"spectron": "13.0.0",
"ts-jest": "26.4.4",
"tslint": "6.1.3",
Expand Down
7 changes: 6 additions & 1 deletion server/src/routes/h5pRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ export default function (

router.get(`/:contentId/play`, async (req, res) => {
try {
const content = await h5pPlayer.render(req.params.contentId);
const content = (await h5pPlayer.render(
req.params.contentId
)) as H5P.IPlayerModel;
// We override the embed types to make sure content always resizes
// properly.
content.embedTypes = ['iframe'];
res.send(content);
res.status(200).end();
} catch (error) {
Expand Down

0 comments on commit eb4e201

Please sign in to comment.