edx-platform icon indicating copy to clipboard operation
edx-platform copied to clipboard

Decouple Video Block from content/static store bindings via VideoConfigService

Open farhan opened this issue 2 weeks ago • 0 comments

Main ticket: https://github.com/openedx/edx-platform/issues/36282 Relevant xblocks-contrib PR comment: comment

Details:

This PR decouples the remaining dependency of the Video Block that is dependency on the content store.

VideoBlock needs to access the content-store for the persistence of the transcripts as a static content.

VideoBlock code access content-store via transcripts_utils mainly via transcripts_utils.Transcript.get_asset() method.

We have already introduced the following three transcript-related methods in VideoConfigService. These methods are generic and abstract much of the underlying logic. For example, get_transcript encapsulates the logic required to fetch transcripts from either Learning Core or the Content Store.

def get_transcript(
        self,
        video_block,
        lang: str | None = None,
        output_format: str = 'srt',
        youtube_id: str | None = None,
) -> tuple[bytes, str, str]:
    
    ---
    
def upload_transcript(
        self,
        *,
        video_block,
        language_code: str,
        new_language_code: str | None,
        transcript_file: File,
        edx_video_id: str | None,
) -> None:
    
    
    ---
    
def delete_transcript(
        self,
        *,
        video_block,
        edx_video_id: str | None,
        language_code: str,
) -> None:


    ---    

farhan avatar Dec 12 '25 08:12 farhan