Skip to content
Open
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
15 changes: 14 additions & 1 deletion src/components/widget-player.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ const WidgetPlayer = ({instanceId, playId, minHeight=0, minWidth=0,showFooter=tr
}
else if( ! ['react-devtools-content-script', 'react-devtools-bridge', 'react-devtools-inject-backend'].includes(e.data.source)) {
throw new Error(
`Post message Origin does not match. Expected: ${expectedOrigin}, Actual: ${origin}`
`Post message Origin does not match. Expected: ${window.BASE_URL} || ${window.STATIC_CROSSDOMAIN}, Actual: ${origin}`
)
}
}
Expand Down Expand Up @@ -544,6 +544,19 @@ const WidgetPlayer = ({instanceId, playId, minHeight=0, minWidth=0,showFooter=tr
const min_h = inst.widget.height
let desiredHeight = Math.max(h, min_h)
setAttributes((oldData) => ({...oldData, height: `${desiredHeight}px`}))


const params = new URLSearchParams(window.location.search)
// The presence of the token param indicates an LTI play. Send the frameResize postMessage to the parent frame (the LMS)
if (params.get('token')) {
window.parent.postMessage(
{
subject: 'lti.frameResize',
height: desiredHeight + 60, // add 60 to desiredHeight for footer
},
'*'
)
}
}

const _setVerticalScroll = location => {
Expand Down
Loading