Introduction:
This wiki explains how to use public & external videos in ECML content.
Background
Currently, the creator can add a video into an ECML content by adding a Youtube URL/Google Drive URL.
If the Youtube or Google Drive video is taken down/ removed, the video content becomes unavailable. There is no way to restrict that from happening, though it continues to work on the mobile app as it was packaged inside ECAR for offline use.
Both Youtube and Google Drive videos become a drawback to access the content offline on the web.
Problem Statement
If public & external video removed from the source it is getting removed from the content as well. (ECML content is still referring the external source so it is not playable).
Support to add local videos to ECML.
Design :
Solution 1: Video as an asset
To add an image into ECML content we should create an asset of type image (image asset). All the image assets are part of the Sunbird installation infra so, they are always available and the Editor enables the creators to reuse existing images.
Similarly, if we should create any public video (local, youtube, google-drive etc,.) as an asset of type video (video asset) and enable the creator to browse and add it to ECML content. With this, all the videos will be available in the Sunbird installation infra.
Below are the two backdrops by following this approach.
If we create video assets and add them to ECML content, by default the videos are not streamable.
The platform takes a minimum of 1 hour time to generate
streamingUrl
.
Option 1: Allow the creator to add videos that are having streamingUrl
.
Option 2: Validate streamingUrl
of video assets at the time of send for review.
a. Submitting for review should validate all the video assets are having streamingUrl
or not. If not, it should show a message to try after some time.
b. There should be a handler to check all the video assets used in the content are having streamingUrl
.
Option 3: ECML content streamingUrl
generation as an async job.
The platform uses an async job to generate and set streamingUrl
for Resource type content which has video as actual data (mimeType: video/*). Likewise, have an async job to set the streamingUrl
for ECML content.
Below is the change in ECML to support video as an asset and streamingUrl
.
Added asset attribute in the org.ekstep.video tag
Video renderer will play video based on media tag’s attribute
src/ streamingUrl
ECML:
<stage> <manifest> <media assetId="do_31244094803238912023058"/> </manifest> <org.ekstep.video asset="do_31244094803238912023058" y="7.9" x="10.97" w="78.4" h="79.51" rotate="0" z-index="0" id="b2600e00-0395-4d63-a3a1-3957db2dec12"> <config> <![CDATA[{"autoplay":true,"controls":true,"muted":false,"visible":true,"url":"/assets/public/content/do_31244094803238912023058/artifact/testvideo.mp4"}]]> </config> </org.ekstep.video> </stage> <manifest> <media id="do_31244094803238912023058" src="/assets/public/content/do_31244094803238912023058/artifact/testvideo.mp4" streamingUrl="" type="video"/> </manifest>
Solution 2: Make Consistent behavior on both Mobile & Portal
Currently, when the uploaded asset is taken down the mobile app continues to play it as it is bundled as an ECAR file and the src of the asset is pointing to one of the bundled assets. To maintain consistency, mobile content should point to the actual external URL.