Open kylehuynh205 opened 1 year ago
Navigate to /admin/config/development/asset-injector/js/add
and copy-paste the code below.
Check 'Requires jQuery' under advanced options and save.
var observer = new MutationObserver(function(mutations, observer) {
// check if transcript toggle exists
if (jQuery("div.able-button-handler-transcript").length) {
var toggle = jQuery("div.able-button-handler-transcript");
if (toggle.hasClass('buttonOff')) {
toggle.click();
}
observer.disconnect();
}
});
// Start observing
observer.observe(document.body, {
childList: true,
subtree: true
});
In islandora_lite, the caption and transcript buttons are missing from the video player controls. The audio player does not have this issue, and the controls display and function normally.
In Islandora-Devops/isle-dc starter_dev, the caption and transcript buttons are missing from the audio player but are present in the video player.
To see a full list of available functions, run:
Ableplayer.prototype
To toggle the transcript button:
AblePlayerInstances[0].handleTranscriptToggle()
To check if transcript is turned on (0 = off, 1 = on):
AblePlayerInstances[0].prefTranscript
Scenario:
Since the changes were made directly into the library in Able Player module. we have to use our version at https://github.com/digitalutsc/ableplayer/tree/islandra-lite instead of the main repository in Drupal.org (https://www.drupal.org/project/ableplayer). Which can result to our version being out of date compared to the main repository.
TODO:
Move development work (from screenshots) from the branch(https://github.com/digitalutsc/ableplayer/tree/islandra-lite) to a custom javascript or a patch, or find a better way to integrate those changes without overwrite the original Able player library