# Inline H5P activity fitting

Inline activities use the shared authenticated viewport-fitting protocol in both the React learner preview and exported course player. Each iframe load sends the existing initialization message followed by a fit request carrying the same activity ID and nonce. The bridge verifies frame ownership and the nonce before enabling fitting.

The bridge scales the complete learning card, including its heading, instructions, activity controls and feedback, to the inline frame and centers it. Its existing resize and content observers recalculate the fit when results expand, content changes, fonts or images load, or the viewport changes. Scaling does not rewrite authored dimensions, answers, completion state or tracking identities.

Inline wrappers do not scroll, and their iframes can shrink below the general player minimum height. Inline live-appearance previews enable the same fitting behavior by default. The fit changes do not opt other activity presentation modes into a different layout.

Already downloaded packages require a rebuild to receive updated player assets. If saved slide edits are awaiting rendering, generate course slides first, then build the course package through the normal editor workflow.

Validation: production build, 44 focused preview/runtime/state tests and 37 H5P UX tests passed. Coverage includes the fit handshake on reload, preserved progress, expanding and collapsing feedback, desktop/mobile viewport dimensions, English/Arabic content and the eight activity types. Native Chrome accessibility inspection reached the question, choices and Check control; screen capture timed out, so these checks do not establish browser visual or mobile acceptance.
