Skip to content

Conversation

@suhaibabsi-inst
Copy link
Contributor

@suhaibabsi-inst suhaibabsi-inst commented Dec 22, 2025

refs: MBL-19574
affects: Student, Teacher, Parent
builds: Student, Teacher, Parent
release note: Enhanced experience for media embeds

Changes

This is mainly to support the following functions related to iframes of Studio media:

1- Adding javascript file (CanvasLTIPostMessageHandler.js) provided by Studio team, to fix an issue of resizing for content loaded into WebView as an HTML text.
2- Inserting "Open in Details View" button below each studio media LTI frame.
3- Support launching immersive view for Studio media, by 3 ways: Tapping on "Open in Details View" button, tapping on "Expand View" button (of menu item) which loaded into the iframe, and tapping on the iframe itself (only for the case thumbnail embed).

The handling is done by 2 main ways:

1- Examining URL of navigation action passed to WebView delegate method: webView(_:decidePolicyFor:decisionHandler:)
2- Handling a WebView message fullWindowLaunch which is posted in CanvasLTIPostMessageHandler.js:298 upon listening to iframe requestFullWindowLaunch message event.

For more details on the specs of those frames, see document linked in ticket description.

Test Plan

  • Create a page with a couple of videos embedded through Studio LTI.
  • In iOS app, on page appearance, "Open in Details View" should show up right below each video
  • Make sure to turn on flag "RCE Studio Embed improvements" on course level in order to see "Open in Details View" buttons, you should also see that button be removed when that flag is off.
  • Upon tapping on one of those buttons, a modal for the immersive media player must show up. See ticket's description for the visual requirements of that screen.
  • Moreover, tapping on "Expand view" button must also trigger modal screen of immersive view on all Studio embed types.
  • For thumbnail embeds, tapping on video thumbnail image must also show modal screen of immersive view.

Known Issues

Still waiting for BE team to provide a way to distinguish archived media, so we can avoid inserting "Open in details view" button below them.

Checklist

  • Follow-up e2e test ticket created
  • A11y checked
  • Tested on phone
  • Tested on tablet
  • Tested in dark mode
  • Tested in light mode
  • Approve from product

refs: MBL-19574
affects: Student, Teacher, Parent
builds: Student, Teacher, Parent
release note: Enhanced experience for media embeds
@suhaibabsi-inst suhaibabsi-inst self-assigned this Dec 22, 2025
@suhaibabsi-inst suhaibabsi-inst changed the title Restore Previous changed for Studio embeds [MBL-19574][S/T/P] Support Studio, Quiz & Archive embeds in WebView & Immersive view Dec 22, 2025
@inst-danger
Copy link
Contributor

inst-danger commented Dec 22, 2025

Warnings
⚠️ One or more files are below the minimum test coverage 50%

Release Note:

Enhanced experience for media embeds

Affected Apps: Student, Teacher, Parent

Builds: Student, Teacher, Parent

MBL-19574

Coverage New % Master % Delta
Canvas iOS 91.09% 81.06% 10.02%
Horizon/Horizon/Sources/Common/View/CourseDetailsAccessibility.swift 0% -- --

Generated by 🚫 dangerJS against c823a17

@inst-danger
Copy link
Contributor

inst-danger commented Dec 22, 2025

Builds

Commit: Fix names (c823a17)
Build Number: 1064
Built At: Dec 28 09:43 CET (12/28 01:43 AM MST)

Student
Teacher
Parent

@instructure instructure deleted a comment from claude bot Dec 25, 2025
@claude
Copy link

claude bot commented Dec 28, 2025

Claude Code Review

Updated: 2025-12-28

Critical Issues Fixed ✅

  • Double URL encoding: RESOLVED - Swift now properly encodes URLs using URLQueryItem, eliminating the previous double-encoding issue.

Remaining Issues

  • Missing script file fallback: Bundle resource loading silently returns nil if files missing. No logging/assertions to detect early. Add os_log or assert().

  • Accumulated DOMContentLoaded listeners: Event listeners added without {once: true}. Accumulate on reloads, causing duplicate button injection execution.

  • URL parsing without validation: findCanvasUploadLink() and findLtiEmbedLink() call new URL() which throws on relative paths. Validate absolute URLs first.

Minor

  • Fragile duplicate detection uses == 1 instead of === true
  • Title sanitization only removes first .mp4 occurrence

Improvements ✅

  • JavaScript extracted to separate files (cleaner maintenance)
  • Script injection order explicit (insertValues → insertScript dependency clear)
  • LTI embed support added alongside Canvas uploads
  • New CanvasLTIPostMessageHandler for iframe resize functionality

✅ Approved with minor observations

@instructure instructure deleted a comment from claude bot Dec 28, 2025
@instructure instructure deleted a comment from claude bot Dec 28, 2025
@suhaibabsi-inst suhaibabsi-inst marked this pull request as ready for review December 28, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants