mitodl / odl-video-service

building blocks for a basic video service for ODL
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Mp4 video download #1011

Closed collinpreston closed 1 year ago

collinpreston commented 1 year ago

Pre-Flight checklist

What are the relevant tickets?

https://github.com/mitodl/mitxonline/issues/1183

What's this PR do?

Creates an MP4 video when a user uploads a video to OVS through Dropbox. The MP4 video will then be included with the HLS video that is uploaded to edX Studio. This allows the Course creator the ability to enable downloading of the video.

How should this be manually tested?

  1. Create a new collection
  2. Set the collections course ID to course-v1:edX+E2E-101+course
  3. Go to http://ovs.odl.local:8089/admin/ui/collectionedxendpoint/ and create a new record for the collection from step 1 using the OVS edxendpoint that was configured in the "Within OVS:" step 2 below.
  4. Run docker-compose run web ./manage.py createpresets --json config/et_mp4_preset.json which should return a preset ID from AWS.
  5. Set ET_MP4_PRESET_ID in your .env file to the preset ID from step 4.
  6. Click "Add Videos from Dropbox" and select a sample video from Dropbox.
  7. Once the video's status has changed to "complete" verify that the VideoFiles have been created at http://ovs.odl.local:8089/admin/ui/videofile/. There should be an original, mp4, and HLS.
  8. Verify the encoded video URLs are found on edx and are reachable through your browser: http://localhost:18000/admin/edxval/video/ (click on the new video record to see the encoded video URLs). Write down the video ID for the next step.
  9. Go into edx studio http://localhost:18010/course/course-v1:edX+E2E-101+course and attempt to add the video to your course using the video ID. When adding the video, go to the "advanced" setting tab and mark "Video Download Allowed" to TRUE.
  10. Publish your course changes.
  11. Verify that you can view the video and download the MP4 from the course page.
  12. Go back to OVS and delete the video. This will remove the video from OVS and S3.

Where should the reviewer start?

Have the following up and running:

Within devstack:

  1. Create a new configuration at http://localhost:18000/admin/oauth2_provider/application/ client ID: g0cdI7l6ERWiYGBMjeqrtfdK2EWN7GDIMQKLCRIU user: edx client type: public Authorization grant type: Client Credentials Client secret: any of your own gibberish Name: OVS Skip authorization: checked

  2. Create a new access token at http://localhost:18000/admin/oauth2_provider/accesstoken/ User: edx Token: HcodEoc5NLjR6I7J05bt7Dw6mLrNHL Application: OVS Expires: set this far into the future scopes: read write email profile

Within OVS:

  1. Feel free to reach out to @collinpreston for the OVS .env file.
  2. Create a new entry at http://ovs.odl.local:8089/admin/ui/edxendpoint/ Name: local devstack Base Url: http://host.docker.internal:18000 Access Token: access token value from devstack Expires in: 0 edx video api path: /api/val/v0/videos/ Client id: g0cdI7l6ERWiYGBMjeqrtfdK2EWN7GDIMQKLCRIU Secret Key: secret key from devstack step 1.
codecov-commenter commented 1 year ago

Codecov Report

Merging #1011 (a022198) into master (f8e3d0d) will increase coverage by 1.41%. The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1011      +/-   ##
==========================================
+ Coverage   96.03%   97.44%   +1.41%     
==========================================
  Files         182      131      -51     
  Lines        7345     4781    -2564     
  Branches      251        0     -251     
==========================================
- Hits         7054     4659    -2395     
+ Misses        257      122     -135     
+ Partials       34        0      -34     
Impacted Files Coverage Δ
cloudsync/api.py
cloudsync/management/commands/createpresets.py
cloudsync/tasks.py
odl_video/settings.py
ui/api.py
ui/encodings.py
ui/models.py
ui/signals.py
ui/tasks.py
odl_video/__init__.py
... and 41 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.