Skip to content

VideoBlock code Optimization/Correction#38012

Merged
farhan merged 1 commit intomasterfrom
farhan/video-code-optimization
Feb 17, 2026
Merged

VideoBlock code Optimization/Correction#38012
farhan merged 1 commit intomasterfrom
farhan/video-code-optimization

Conversation

@farhan
Copy link
Contributor

@farhan farhan commented Feb 16, 2026

We are going to do these changes for the extracted Video Block resides in xblocks-contrib in this PR.

Aximprovements team has decided we should directly do the changes within edx-platform for the code correction and it will get early test/response by the community.

Relevant old PR of edx-platform

Details:

  • Change the i18n service declaration from wants to needs, since the runtime must provide it for the block to function correctly.
  • Update the public_view webpack JS reference from VideoBlockMain to VideoBlockDisplay, as all VideoBlock JS files are bundled into VideoBlockDisplay and VideoBlockMain is not referring to anything or no longer exists in the repository.

Testing/Screenshots:

I have verified on Preview/Live Version/LMS/Studio, video block in redering fine on sandbox and local setup.
Here are the screenshots.

Screenshot 2026-02-17 at 11 46 53 AM
screencapture-apps-local-openedx-io-2001-authoring-course-course-v1-axim-1-1-container-block-v1-axim-1-1-type-vertical-block-vertical3-block-v1-axim-1-1-type-sequential-block-e90f308c5b314389899787459ced3361-2026-02-17-12_08_14
screencapture-apps-local-openedx-io-2000-learning-course-course-v1-axim-1-1-block-v1-axim-1-1-type-sequential-block-e90f308c5b314389899787459ced3361-block-v1-axim-1-1-type-vertical-block-vertical3-2026-02-17-12_08_08

- Change the `i18n` service declaration from `wants` to `needs`, since the
  runtime must provide it for the block to function correctly.

- Update the `public_view` webpack JS reference from `VideoBlockMain` to
  `VideoBlockDisplay`, as all VideoBlock JS files are bundled into
  `VideoBlockDisplay` and `VideoBlockMain` is not referring to anything
   or no longer exists in the repository.
@farhan farhan added the create-sandbox open-craft-grove should create a sandbox environment from this PR label Feb 16, 2026
@farhan farhan marked this pull request as ready for review February 17, 2026 07:10
@@ -265,7 +265,7 @@ def public_view(self, context):

Copy link
Contributor

@salman2013 salman2013 Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farhan public_view actually return the view seen by users who aren't logged in or who aren't enrolled in the course.(anonymous users)

Can you figure out how to test this because the testing results you shared are for student_view

I found this doc how to enable public course
https://docs.openedx.org/en/latest/site_ops/how-tos/enable_public_course_content.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this on both the sandbox and my local setup (tutor dev), but I wasn’t able to load the Video block in incognito mode as a logged-out user.

@kdmccormick, do you know whether the Video public view access feature is currently working?

Copy link
Contributor Author

@farhan farhan Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems feature is breaking while shifting to the mfes.
I managed to fix it via vibe coding/cursor and created test PR with the generated code.

After the fix, here is the preview:

Screenshot

With vibed fixing code and reverting line from
add_webpack_js_to_fragment(fragment, 'VideoBlockDisplay')
to
add_webpack_js_to_fragment(fragment, 'VideoBlockMain')
for the testing of the issue, here is the screen shot:

Screenshot

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farhan I don't think we need this fix PR, as i found where this was changed previously Ref I believe VideoBlockMain did not exist earlier.

@farhan farhan requested a review from salman2013 February 17, 2026 15:19
@farhan farhan moved this to 🏗 In progress in Aximprovements Team Feb 17, 2026
@salman2013
Copy link
Contributor

@farhan I found where this was changed previously, It was updated in the PR Migrating from RequireJS to ES6 Modules https://github.com/openedx/openedx-platform/pull/36595/changes#diff-0c437f410aa8b98a76aa91ccd72e2b9c2da8c49f09168fa66ed63861529eebaf

Copy link
Contributor

@salman2013 salman2013 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the provided test results and previous change logs, it looks good to me.

@farhan farhan merged commit 8dd99de into master Feb 17, 2026
70 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Aximprovements Team Feb 17, 2026
@farhan farhan deleted the farhan/video-code-optimization branch February 17, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create-sandbox open-craft-grove should create a sandbox environment from this PR

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants

Comments