Using youtube api (v3) instead of v2 to get the video duration .
TNL-2413
This commit is contained in:
@@ -118,8 +118,8 @@ except ImportError:
|
||||
pass
|
||||
|
||||
# Point the URL used to test YouTube availability to our stub YouTube server
|
||||
YOUTUBE['API'] = "127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEST_URL'] = "127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['API'] = "http://127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['METADATA_URL'] = "http://127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEXT_API']['url'] = "127.0.0.1:{0}/test_transcripts_youtube/".format(YOUTUBE_PORT)
|
||||
|
||||
# Generate a random UUID so that different runs of acceptance tests don't break each other
|
||||
|
||||
@@ -348,3 +348,4 @@ if FEATURES['ENABLE_COURSEWARE_INDEX'] or FEATURES['ENABLE_LIBRARY_INDEX']:
|
||||
|
||||
XBLOCK_SETTINGS = ENV_TOKENS.get('XBLOCK_SETTINGS', {})
|
||||
XBLOCK_SETTINGS.setdefault("VideoDescriptor", {})["licensing_enabled"] = FEATURES.get("LICENSING", False)
|
||||
XBLOCK_SETTINGS.setdefault("VideoModule", {})['YOUTUBE_API_KEY'] = AUTH_TOKENS.get('YOUTUBE_API_KEY', YOUTUBE_API_KEY)
|
||||
|
||||
@@ -103,8 +103,8 @@ FEATURES['ENTRANCE_EXAMS'] = True
|
||||
|
||||
# Point the URL used to test YouTube availability to our stub YouTube server
|
||||
YOUTUBE_PORT = 9080
|
||||
YOUTUBE['API'] = "127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEST_URL'] = "127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['API'] = "http://127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['METADATA_URL'] = "http://127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEXT_API']['url'] = "127.0.0.1:{0}/test_transcripts_youtube/".format(YOUTUBE_PORT)
|
||||
|
||||
FEATURES['ENABLE_COURSEWARE_INDEX'] = True
|
||||
|
||||
@@ -44,7 +44,7 @@ from lms.envs.common import (
|
||||
PROFILE_IMAGE_SECRET_KEY, PROFILE_IMAGE_MIN_BYTES, PROFILE_IMAGE_MAX_BYTES,
|
||||
# The following setting is included as it is used to check whether to
|
||||
# display credit eligibility table on the CMS or not.
|
||||
ENABLE_CREDIT_ELIGIBILITY
|
||||
ENABLE_CREDIT_ELIGIBILITY, YOUTUBE_API_KEY
|
||||
)
|
||||
from path import path
|
||||
from warnings import simplefilter
|
||||
@@ -654,10 +654,10 @@ CELERY_QUEUES = {
|
||||
|
||||
YOUTUBE = {
|
||||
# YouTube JavaScript API
|
||||
'API': 'www.youtube.com/iframe_api',
|
||||
'API': 'https://www.youtube.com/iframe_api',
|
||||
|
||||
# URL to test YouTube availability
|
||||
'TEST_URL': 'gdata.youtube.com/feeds/api/videos/',
|
||||
# URL to get YouTube metadata
|
||||
'METADATA_URL': 'https://www.googleapis.com/youtube/v3/videos',
|
||||
|
||||
# Current youtube api for requesting transcripts.
|
||||
# For example: http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g.
|
||||
@@ -996,6 +996,9 @@ ELASTIC_FIELD_MAPPINGS = {
|
||||
XBLOCK_SETTINGS = {
|
||||
"VideoDescriptor": {
|
||||
"licensing_enabled": FEATURES.get("LICENSING", False)
|
||||
},
|
||||
'VideoModule': {
|
||||
'YOUTUBE_API_KEY': YOUTUBE_API_KEY
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
|
||||
<h2>Video</h2>
|
||||
|
||||
<div id="video_i4x-AndyA-ABT101-video-72b5a0d74e8c4ed4a4d4e6bf67837c09" class="video closed is-initialized" data-streams="1.00:OEoXaMPEzfM" data-save-state-url="/preview/xblock/i4x:;_;_AndyA;_ABT101;_video;_72b5a0d74e8c4ed4a4d4e6bf67837c09/handler/xmodule_handler/save_user_state" data-caption-data-dir="None" data-show-captions="true" data-general-speed="1.0" data-speed="null" data-start="0.0" data-end="0.0" data-caption-asset-path="/c4x/AndyA/ABT101/asset/subs_" data-autoplay="False" data-yt-test-timeout="1500" data-yt-test-url="https://gdata.youtube.com/feeds/api/videos/" data-autohide-html5="False" tabindex="-1">
|
||||
<div id="video_i4x-AndyA-ABT101-video-72b5a0d74e8c4ed4a4d4e6bf67837c09" class="video closed is-initialized" data-streams="1.00:OEoXaMPEzfM" data-save-state-url="/preview/xblock/i4x:;_;_AndyA;_ABT101;_video;_72b5a0d74e8c4ed4a4d4e6bf67837c09/handler/xmodule_handler/save_user_state" data-caption-data-dir="None" data-show-captions="true" data-general-speed="1.0" data-speed="null" data-start="0.0" data-end="0.0" data-caption-asset-path="/c4x/AndyA/ABT101/asset/subs_" data-autoplay="False" data-yt-test-timeout="1500" data-yt-test-url="https://www.googleapis.com/youtube/v3/videos/" data-autohide-html5="False" tabindex="-1">
|
||||
<div class="focus_grabber first" tabindex="-1"></div>
|
||||
|
||||
<div class="tc-wrapper">
|
||||
|
||||
Reference in New Issue
Block a user