The Video Player XBlock will sometimes make API calls to /couses/yt_video_metadata, a REST API endpoint that in turn loads video metadata from YouTube using the configured settings.YOUTUBE_API_KEY.
However, in the Blockstore-based XBlock runtime, we are running XBlocks in a secure sandbox, and the user's browser cannot pass session cookies when calling REST API endpoints. So currently, the video XBlock tries to request YouTube metadata from that API endpoint, but it fails if run within such a sandbox.
The existing API also doesn't work for anonymous users (users who are allowed to see video XBlocks but who have not logged in to an LMS user account).
This commit updates the Video XBlock so that it can use a handler to load the data from YouTube instead of a generic REST API. This works well in the new runtime, because it has code to support calling handlers within the sandbox, including by anonymous users.
I also fixed a bug where on a default devstack, the endpoint will try calling YouTube using PUT_YOUR_API_KEY_HERE as an API key, and get a "bad request" error from YouTube.
The code could be re-organized by moving things around, but I've left everything as-is for now to keep the diff as small as possible.
Dictionaries are being rendered into the HTML but in different order between python2 and python3.
The function parses and sorts the dictionary so that we get ordered data that can be compared in tests cases.
Dictionaries are being rendered into the HTML but in different order between python2 and python3 and failing tests in python3.
The function parses and sorts the dictionary so that we get ordered data that can be compared in tests cases.
Some deprecated functionality has been removed:
- Reading data field and transforms being applied in the init() method.
- The source field.
- The source_visible attribute.
* updated files according to INCR-265
* fixed docstring and line-length problems from quality test
* Revert "fixed docstring and line-length problems from quality test"
This reverts commit d050f55a4ecfaa38f46b80ec4bb85ff399a79a8c.
* fixed errors reported in quality report
* had error, fixed it
* reversed change
* fixed over/under indentation, and added line to import.py that Ned had suggested
* tried disabling pylint for this line
* testing new email
* testing email in different window
* re-added symlink and docstring
This is based on PR #19284 and is part of the
series of work related to the proposal #18134.
Adds VideoModule.public_view() to enable
unenrolled and anonymous users to view the video
contents of a public course.
When an unenrolled or anonymous user accesses the
video content of a public course, the
public_view() introduced in the previous PR is
used instead of student_view() method.
These were very early experiments by the old performance team
on using CDNs for videos and logging performance data. No one
is looking at this data and it's just extra cruft on every page.
If enabled for a course, as soon as the video ends, the next unit or subsection
will be loaded, and if it contains a single video, that video will be played.
Course authors can enable the setting for a course, but learners can toggle the
setting on or off once it's enabled on the course.
Update the VideoModule to publish a completion event when the player
reaches 95% complete, and submit a BlockCompletion when that event
occurs.
OC-3091
MCKIN-5897