Skip to content

Conversation

@salman2013
Copy link
Contributor

@salman2013 salman2013 commented Oct 20, 2025

Description

In this PR

  • I converted the builtin video block's html from mako template to django template
  • I just converted video.html template which is rendering in student_view, public_view and author_view.
  • Render django template in video_block.py with the class ResourceLoader from Xblock
  • I left studio_view as it is because there is already deprecation ticket to remove legacy video editor which is rendering in studio_view.

Alternate Approach/ considerations:

I also tried using Django’s built-in template loader (django.template.loaders) to render the template. It successfully found the HTML file under lms/templates when running in the LMS, but not in the CMS. The reason is that the CMS (settings) do not include a path to read files from the lms directory, and the file exists only within the LMS app.
In this approach if we update the video.html location from lms/templates to common/templates it render properly on both CMS and LMS

Reasons:

We are transitioning from Mako to Django templates.
Eventually we have to extract out the Video Block into xblocks-contrib repository

Ticket: openedx/public-engineering#427

Acceptance Criteria:

  • html template should be refactored to django template with minimal code changes
  • Video XBlock experience shouldn't be changed
  • All unit and karma test cases should be passed on the edx-platform

Testing results:

I tested this PR on sandbox with following video formats.

Youtube

Screenshot 2025-11-11 at 10 19 32 PM

Youtube with transcript

Screenshot 2025-11-11 at 10 19 47 PM

Mp4

Screenshot 2025-11-11 at 10 20 00 PM

HLS
Screenshot 2025-11-12 at 3 46 31 PM

webm

Screenshot 2025-11-11 at 10 20 21 PM

In-video quiz

Screenshot 2025-11-11 at 10 24 38 PM

Video Sharing

Screenshot 2025-11-13 at 6 29 59 PM

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 20, 2025
@openedx-webhooks
Copy link

openedx-webhooks commented Oct 20, 2025

Thanks for the pull request, @salman2013!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Oct 20, 2025
@salman2013 salman2013 added the create-sandbox open-craft-grove should create a sandbox environment from this PR label Oct 20, 2025
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Configuration information unavailable

2 similar comments
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Configuration information unavailable

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Configuration information unavailable

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Configuration information unavailable

1 similar comment
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Configuration information unavailable

@salman2013 salman2013 force-pushed the salman/convert-video-django-template branch from 59e3049 to dfd509a Compare October 23, 2025 13:06
@salman2013 salman2013 changed the title chore: update video block template from mako to django Convert BuiltIn Video Block's html from mako template into django template Oct 23, 2025
@open-craft-grove
Copy link

Sandbox deployment failed 💥
Please check the settings and requirements.
Retry deployment by pushing a new commit or updating the requirements/settings in the pull request's description.
📜 Failure Logs
ℹ️ Configuration information unavailable

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Configuration information unavailable

@kdmccormick kdmccormick self-requested a review October 23, 2025 14:31
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Configuration information unavailable

@open-craft-grove
Copy link

Sandbox deployment failed 💥
Please check the settings and requirements.
Retry deployment by pushing a new commit or updating the requirements/settings in the pull request's description.
📜 Failure Logs
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@salman2013 salman2013 force-pushed the salman/convert-video-django-template branch from b7a20f2 to caa9f36 Compare October 30, 2025 11:41
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@salman2013 salman2013 force-pushed the salman/convert-video-django-template branch from efd3fb1 to cd7f16a Compare November 3, 2025 17:06
@salman2013 salman2013 marked this pull request as draft November 6, 2025 09:50
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@salman2013 salman2013 force-pushed the salman/convert-video-django-template branch from 7d25eb4 to 427721b Compare November 7, 2025 07:03
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@salman2013 salman2013 force-pushed the salman/convert-video-django-template branch from 20d2e65 to 204e35b Compare November 11, 2025 13:41
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@salman2013 salman2013 marked this pull request as ready for review November 12, 2025 10:47
@salman2013 salman2013 requested a review from farhan November 12, 2025 10:54
Copy link
Contributor

@farhan farhan left a comment

Choose a reason for hiding this comment

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

PR looks good now.

If we could do the manual testing of the disabled features that will be great.
For example:

  • Video Sharing
  • sendPerformanceBeacon methods

id="google-translate-logo"
src="https://learning.edx.org/d4ab1b25143ecad62d69d855b00e7313.png"
alt="Translated by Google logo"
alt="{% trans 'Translated by Google logo' as tmsg %}{{tmsg|force_escape}}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's keep it un-translated as in the original file

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 have reverted it.

@mphilbrick211 mphilbrick211 moved this from Waiting on Author to In Eng Review in Contributions Nov 13, 2025
@salman2013 salman2013 force-pushed the salman/convert-video-django-template branch from 14082e3 to 8b92a20 Compare November 14, 2025 13:10
@salman2013
Copy link
Contributor Author

salman2013 commented Nov 14, 2025

@farhan thanks for the feedback.

Video Sharing
I have already tested the video sharing functionality and added the testing result in PR description.

sendPerformanceBeacon methods

By default the script is disabled inside video_block
In history why it was disabled i found this useful information.

I have tested and compared it with the master branch by enabling and disabling cdn_eval , the video playback experience and console logs seems the same on both master and with the changes in this PR.

@salman2013 salman2013 requested a review from farhan November 14, 2025 13:53
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

Copy link
Contributor

@farhan farhan left a comment

Choose a reason for hiding this comment

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

Looks good to me now

Copy link
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

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

Looks great!

@kdmccormick kdmccormick merged commit d516736 into master Nov 18, 2025
53 checks passed
@kdmccormick kdmccormick deleted the salman/convert-video-django-template branch November 18, 2025 15:59
@github-project-automation github-project-automation bot moved this from In Eng Review to Done in Contributions Nov 18, 2025
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 open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants