Skip to content

Extract Video Block from edx-platform | Update the shifted Video XBlock code#142

Open
farhan wants to merge 11 commits intofarhan/video-block-lift-and-siftfrom
farhan/update-shifted-video-block-code
Open

Extract Video Block from edx-platform | Update the shifted Video XBlock code#142
farhan wants to merge 11 commits intofarhan/video-block-lift-and-siftfrom
farhan/update-shifted-video-block-code

Conversation

@farhan
Copy link
Contributor

@farhan farhan commented Jan 23, 2026

Ticket

Description:

Code has been updated in this PR to make Video Block independent from the edx-platform.

  • Quality fixes ✅ have been done in this child PR for the ease of code review of this PR.
  • Predecessor PR having source (lift & shift code)
  • edx-platform test cases PR
  • Video block test cases (migrating from edx-platform) PR
  • Karma test cases PR that will be merged after this PR

Extracted Video XBlock Sandbox to test the whole extraction: sandbox-pr

Testing Notes:

  • Review the predecessor PR and make sure all the original code has been lifted and shifted correctly.
  • Review this PR

Extracted Video XBlock can be manually tested on the local machine setup up.

Known Issues/Pending Stories in Video XBlock Extraction:

edx-platform prior work:

Following is the prior work already done in the edx-platform to decouple Video Block from platform by introducing VideoConfigService
openedx/openedx-platform#37829
openedx/openedx-platform#37809
openedx/openedx-platform#37808
openedx/openedx-platform#37793
openedx/openedx-platform#37779
openedx/openedx-platform#37776
openedx/openedx-platform#37635
openedx/openedx-platform#37631
openedx/openedx-platform#37459

@farhan farhan force-pushed the farhan/update-shifted-video-block-code branch from 102abb6 to 6a3edee Compare January 23, 2026 13:58
@farhan farhan changed the title Update the shifted Video XBlock code to make it run Extract Video Block from edx-platform | Update the shifted Video XBlock code Jan 23, 2026
@farhan farhan force-pushed the farhan/update-shifted-video-block-code branch from 9415c91 to cd2263a Compare January 30, 2026 13:36
@farhan farhan requested review from a team and irtazaakram February 4, 2026 11:33
@farhan farhan self-assigned this Feb 4, 2026
@farhan farhan requested a review from kdmccormick February 4, 2026 14:31
@kdmccormick
Copy link
Member

Upon taking a skim through it, I don't see any issues. @farhan can you have a team member review, and merge it if it looks good to both of you?

@kdmccormick kdmccormick removed their request for review February 5, 2026 22:00
@farhan farhan force-pushed the farhan/video-block-lift-and-sift branch from d684cf3 to 0c374ea Compare February 10, 2026 12:19
@farhan farhan force-pushed the farhan/update-shifted-video-block-code branch from e4a858c to fc8cafa Compare February 10, 2026 12:26
@farhan farhan force-pushed the farhan/update-shifted-video-block-code branch from fc8cafa to 302af97 Compare February 10, 2026 12:27
@@ -0,0 +1,3 @@
node_modules/*
Copy link
Member

Choose a reason for hiding this comment

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

Lets move this to root .gitignore

Comment on lines +7 to +10
"scripts": {
"build": "webpack --config webpack.prod.config.js",
"build-dev": "webpack --config webpack.dev.config.js",
"test": "echo \"Error: no test specified\" && exit 1"
Copy link
Member

Choose a reason for hiding this comment

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

We need to make our root package.json have these commands for it to run.

EmptyDataRawMixin, XmlMixin, EditingMixin, XModuleToXBlockMixin,
ResourceTemplates, XModuleMixin, LicenseMixin):
@XBlock.wants('settings', 'completion', 'request_cache', 'video_config')
@XBlock.needs('i18n', 'user')
Copy link
Member

Choose a reason for hiding this comment

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

what made us move i18n from wants to needs?

return urlunsplit((scheme, netloc, path, new_query_string, fragment))


def deserialize_field(field, value):
Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines +13 to +23
"draggabilly": "^3.0.0",
"edx-ui-toolkit": "1.8.7",
"hls.js": "0.14.17",
"underscore": "^1.13.7",
"webpack-merge": "^6.0.1"
},
"devDependencies": {
"clean-webpack-plugin": "^4.0.0",
"webpack": "^5.99.8",
"webpack-cli": "^6.0.1",
"webpack-manifest-plugin": "^5.0.1"
Copy link
Member

Choose a reason for hiding this comment

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

Are these packages versions inline with edx-platform/package.json?

]
};

module.exports = config
Copy link
Member

Choose a reason for hiding this comment

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

we need to confirm that the bundle produced by this is exactly the same as that of edx-platform's one. Right now I can see alot of differences between both

tabindex="-1"
>
data-package-name="xblocks-contrib"
data-test-id="1">
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this?

Comment on lines +342 to +346
fragment.add_css(loader.load_unicode("static/css/video.css"))
fragment.add_javascript_url(
self.runtime.local_resource_url(self, self._video_js_resource_path())
)
fragment.initialize_js("Video")
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we load both from runtime?

Suggested change
fragment.add_css(loader.load_unicode("static/css/video.css"))
fragment.add_javascript_url(
self.runtime.local_resource_url(self, self._video_js_resource_path())
)
fragment.initialize_js("Video")
fragment.add_css(self.runtime.local_resource_url(self, "public/css/video.css"))
fragment.add_javascript_url(
self.runtime.local_resource_url(self, self._video_js_resource_path())
)
fragment.initialize_js("Video")

return metadata_fields

@property
def editable_metadata_fields(self):
Copy link
Member

Choose a reason for hiding this comment

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

we should've kept it in video block to minimize change.

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