YOUTUBE_API_KEY in Open edX

‘YOUTUBE_API_KEY’ in /edx/etc/lms.yml .

  1. I would like to know which function would need the key ? What the YOUTUBE_API_KEY work for?
  2. If I didn’t put the correct YOUTUBE_API_KEY into lms.yml , what will be the impact?

According to the documentation

If you intend for courses on your Open edX instance to include videos that are hosted on YouTube, you must get a YouTube API key and set the key in the Open edX Platform.

The youtube API key is required by the Video XBlock to work at its full potential.
You’ll still be able to imbed videos without any issues. But some metadata won’t be able to load in both LMS and studio.

Youtube Data API is used by the video block to retrieve:

  • video metadata: not sure what is used by the block (maybe descriptions, language, available quality, etc).
  • video subtitles (timed text) : I found this as an example of subtitles in common.py files. but I am not sure if the video block is actually using youtube’s subtitles.
    http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g

Any further contribution to my answer is more than welcome.
Let us learn more, Open edX and edX folks !! :grinning_face_with_smiling_eyes:

2 Likes

Koa Native. I’ve set up an API and in lms.yml and lms/envs/common.py, switched off the transcripts for videos, restarted the system, but still get the same 3 errors in Firefox:

  1. Blocked loading mixed active content “http://<site_url>/yt_video_metadata?id=3_yD_cEKoCk
  2. XHR GET https://<site_url>/courses/course-v1:history+vd01+2020_12/xblock/block-v1:history+vd01+2020_12+type@video+block@7dc54247412e4eca8d0e9f4f9fe13b01/handler/transcript/translation/en?videoId=3_yD_cEKoCk
    [HTTP/1.1 404 Not Found 649ms]
  3. Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘https://www.youtube.com’) does not match the recipient window’s origin (‘https://<site_url>’)