Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

display_video_subtitles()

Description

Generate HTML to display subtitles in playback of a video resource.

Parameters

ColumnTypeDefaultDescription
$ref int Resource ID
$access int Resource access level - e.g. 0 for open access

Return

void

Location

include/video_functions.php lines 72 to 97

Definition

 
function display_video_subtitles($ref,$access)
    {
    global 
$alt_files_visible_when_restricted;
    
$alt_access=hook("altfilesaccess");

    if (
$access==|| $alt_files_visible_when_restricted)
        {
        
$alt_access=true# open access (not restricted)
        
}

    if (
$alt_access)
        {
        
$video_altfiles=get_alternative_files($ref);

        foreach (
$video_altfiles as $video_altfile)
            {
            if(
mb_strtolower($video_altfile["file_extension"]) =="vtt")
                {
                
$video_altfile["path"] = get_resource_path($reffalse''true$video_altfile["file_extension"], -11false'',  $video_altfile["ref"]);
                
?>
                <track class="videojs_alt_track" kind="subtitles" src=" echo escape($video_altfile["path"]) ?>" label=" echo escape($video_altfile["description"]); ?>" ></track>
                
                
}
            }
        }
    }

This article was last updated 15th December 2024 20:35 Europe/London time based on the source file dated 10th September 2024 23:10 Europe/London time.