Status: Completed

The video image/poster/thumbnail feature will allow users to see static image on video component before they click play just like youtube. To show the poster on video component (as first frame) we'll provide a way to upload image for particular video via "Video Uploads" page. Since our design for this feature adds a significant infrastructure requirement, we're giving it a dedicated design document.   

Functionality

Future (not inclusive)

Upload Video Image End Point

HTTP clients use this end point to upload video images, as well as to update existing ones.

Access Control

Course authors & admin will be able to add / edit the image for videos. 

Also these images will be world readable via S3 link.

Endpoints

video_images/{course_id}/{edx_video_id}

MethodDescriptionAccess
POSTUpload a new video image.  If one already exists, it will be replaced by this one.course staff, admin

Request Details

NOTE: Validation will be added to backend as well as client side.

Response Format

Implementation Considerations

Video Image Usage

Configuring Backend Video Image Storage

Video image field will adopt approach just like block structure's data field https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/content/block_structure/models.py#L166

For devstack we'll be using default Django storage and for production/stage like environment we'll be using s3 

VIDEO_IMAGE_SETTINGS = dict(
    STORAGE_CLASS='storages.backends.s3boto.S3BotoStorage',
    STORAGE_KWARGS=dict(bucket='video-images-test-bucket'),
    DIRECTORY_PREFIX='video_images/',
)

Storage and access for video images

The video images will be stored using Django Storages to abstract away the details of where the images are stored. Here's how it works:

Cleaning up stale images from s3 bucket

To clean the old/stale images from s3 bucket, the real scenario could be if someone uploads an image and update it later, given that we're using timestamp as image name, the old image would be there forever. Here are different approaches that we can take to address this issue: