UNPKG

@haxtheweb/video-player

Version:
1,296 lines (1,295 loc) 41.6 kB
{ "schemaVersion": "1.0.0", "readme": "", "modules": [ { "kind": "javascript-module", "path": "video-player.js", "declarations": [ { "kind": "class", "description": "`video-player`\n`A simple responsive video player with ridiculously powerful backing`", "name": "VideoPlayer", "members": [ { "kind": "field", "name": "haxProperties", "static": true, "readonly": true }, { "kind": "field", "name": "tag", "static": true, "description": "Store tag name to make it easier to obtain directly.", "readonly": true }, { "kind": "method", "name": "querySelectorAll", "parameters": [ { "name": "query" } ] }, { "kind": "field", "name": "html5", "description": "gets the HTML5 `audio` or `video` children", "readonly": true, "return": { "type": { "text": "object" } } }, { "kind": "field", "name": "iframed", "description": "Computes whether uses iframe", "readonly": true, "return": { "type": { "text": "Boolean" } } }, { "kind": "field", "name": "isA11yMedia", "description": "Determines if compatible with `a11y-media-player`", "readonly": true, "return": { "type": { "text": "Boolean" } } }, { "kind": "field", "name": "observer", "description": "mutation observer for tabs", "readonly": true, "return": { "type": { "text": "object" } } }, { "kind": "field", "name": "sandboxed", "description": "Compute sandboxed status", "readonly": true, "return": { "type": { "text": "Boolean" } } }, { "kind": "field", "name": "sourceProperties", "description": "Gets cleaned source list from source and sources properties", "readonly": true, "return": { "type": { "text": "Array" } } }, { "kind": "field", "name": "trackProperties", "description": "Gets cleaned track list from track and tracks properties", "readonly": true, "return": { "type": { "text": "Array" } } }, { "kind": "field", "name": "sourceData", "privacy": "public", "type": { "text": "object" }, "description": "Source properties and slotted sources", "readonly": true, "return": { "type": { "text": "Array" } }, "attribute": "sourceData" }, { "kind": "field", "name": "audioOnly", "readonly": true }, { "kind": "field", "name": "standAlone", "readonly": true }, { "kind": "field", "name": "trackData", "description": "Gets cleaned track list", "readonly": true, "return": { "type": { "text": "Array" } } }, { "kind": "field", "name": "youtubeId", "description": "Gets Youtube ID from source string", "readonly": true, "return": { "type": { "text": "String" } } }, { "kind": "field", "name": "playerId", "description": "gets an id for a11y-media-player", "readonly": true, "return": { "type": { "text": "string" } } }, { "kind": "method", "name": "_computeMediaType", "parameters": [ { "name": "source" } ], "description": "Compute media type based on source, i.e. 'audio/wav' for '.wav'" }, { "kind": "method", "name": "_computeSRC", "parameters": [ { "name": "source" }, { "name": "type" } ], "description": "Compute src from type / source combo.\nType is set by source so this ensures a waterfall\nof valid values." }, { "kind": "method", "name": "haxHooks", "description": "Implements haxHooks to tie into life-cycle if hax exists." }, { "kind": "method", "name": "haxinlineContextMenu", "parameters": [ { "name": "ceMenu" } ], "description": "add buttons when it is in context" }, { "kind": "method", "name": "haxClickTimeCode", "parameters": [ { "name": "e" } ] }, { "kind": "method", "name": "haxpostProcessNodeToContent", "parameters": [ { "name": "content" } ], "description": "postProcesshaxNodeToContent - clean up so we don't have empty array data" }, { "kind": "method", "name": "setSourceData", "description": "triggers an update of sourceData property when slot changes" }, { "kind": "method", "name": "playEvent", "parameters": [ { "name": "e" } ] }, { "kind": "method", "name": "pauseEvent", "parameters": [ { "name": "e" } ] }, { "kind": "field", "name": "currentTime", "description": "mapping down into the shadowRoot element bc these are common things to want to know", "readonly": true }, { "kind": "method", "name": "restart" }, { "kind": "method", "name": "restartEvent" }, { "kind": "method", "name": "pause" }, { "kind": "method", "name": "play" }, { "kind": "method", "name": "seek", "parameters": [ { "name": "time" } ] }, { "kind": "method", "name": "endTimeTest" }, { "kind": "method", "name": "_visChange", "parameters": [ { "name": "e" } ] }, { "kind": "method", "name": "_loadAudioDescriptionPreference", "description": "Load audio description preference from localStorage" }, { "kind": "method", "name": "_saveAudioDescriptionPreference", "description": "Save audio description preference to localStorage" }, { "kind": "method", "name": "_setupAudioDescriptionSync", "description": "Setup audio description sync with video playback" }, { "kind": "method", "name": "toggleAudioDescription", "description": "Toggle audio description on/off" }, { "kind": "method", "name": "_handleAudioDescriptionToggle", "parameters": [ { "name": "e" } ], "description": "Handle audio description toggle from settings checkbox" }, { "kind": "field", "name": "windowControllers", "default": "new AbortController()" }, { "kind": "field", "name": "sourceType", "privacy": "public", "type": { "text": "string" }, "default": "\"\"", "attribute": "sourceType" }, { "kind": "field", "name": "crossorigin", "privacy": "public", "type": { "text": "string" }, "description": "Cross origin flag for transcripts to load", "default": "\"anonymous\"", "attribute": "crossorigin", "reflects": true }, { "kind": "field", "name": "dark", "privacy": "public", "type": { "text": "boolean" }, "description": "Enables darker player.", "default": "false", "attribute": "dark", "reflects": true }, { "kind": "field", "name": "darkTranscript", "privacy": "public", "type": { "text": "boolean" }, "description": "Use dark theme on transcript? Default is false, even when player is dark.", "default": "false", "attribute": "darkTranscript" }, { "kind": "field", "name": "disableInteractive", "privacy": "public", "type": { "text": "boolean" }, "description": "disable interactive mode that makes transcript clickable", "default": "false", "attribute": "disableInteractive" }, { "kind": "field", "name": "hideTimestamps", "privacy": "public", "type": { "text": "boolean" }, "description": "show cue's start and end time", "default": "false", "attribute": "hide-timestamps" }, { "kind": "field", "name": "hideTranscript", "privacy": "public", "type": { "text": "boolean" }, "description": "Hide transcript by default", "default": "false", "attribute": "hide-transcript", "reflects": true }, { "kind": "field", "name": "hideYoutubeLink", "privacy": "public", "type": { "text": "boolean" }, "description": "Open on YouTube button", "default": "false", "attribute": "hide-youtube-link" }, { "kind": "field", "name": "lang", "privacy": "public", "type": { "text": "string" }, "description": "Language of media", "default": "\"en\"", "attribute": "lang" }, { "kind": "field", "name": "playing", "privacy": "public", "type": { "text": "boolean" }, "description": "Data reactivity for play status from a11y-media-player", "default": "false", "attribute": "playing", "reflects": true }, { "kind": "field", "name": "__setVisChange", "type": { "text": "boolean" }, "default": "false" }, { "kind": "field", "name": "allowBackgroundPlay", "privacy": "public", "type": { "text": "boolean" }, "description": "Option to allow playing while not active tab", "default": "false", "attribute": "allow-background-play", "reflects": true }, { "kind": "field", "name": "learningMode", "privacy": "public", "type": { "text": "boolean" }, "description": "Learning mode", "default": "false", "attribute": "learning-mode" }, { "kind": "field", "name": "linkable", "privacy": "public", "type": { "text": "boolean" }, "description": "Include a share link?", "default": "false", "attribute": "linkable" }, { "kind": "field", "name": "sources", "privacy": "public", "type": { "text": "array" }, "description": "Array of multiple video sources", "default": "[]", "attribute": "sources" }, { "kind": "field", "name": "startTime", "privacy": "public", "type": { "text": "null" }, "description": "Start time for video", "default": "null", "attribute": "start-time" }, { "kind": "field", "name": "endTime", "privacy": "public", "type": { "text": "null" }, "description": "End time for video", "default": "null", "attribute": "end-time" }, { "kind": "field", "name": "stickyCorner", "privacy": "public", "type": { "text": "string" }, "description": "When playing but scrolled off screen, to which corner does it \"stick\":\n`top-left`, `top-right`, `bottom-left`, `bottom-right`, or `none`?\nDefault is `top-right`. `None` disables stickiness.", "default": "\"none\"", "attribute": "sticky-corner", "reflects": true }, { "kind": "field", "name": "tracks", "privacy": "public", "type": { "text": "array" }, "description": "Array of text tracks, eg. `[{ \"src\": \"path/to/track.vtt\", \"label\": \"English\", \"srclang\": \"en\", \"kind\": \"subtitles\", }]`", "default": "[]", "attribute": "tracks", "reflects": true }, { "kind": "field", "name": "source", "privacy": "public", "type": { "text": "string" }, "description": "Single sources of video", "default": "\"\"", "attribute": "source", "reflects": true }, { "kind": "field", "name": "audioDescriptionSource", "privacy": "public", "type": { "text": "string" }, "description": "URL to audio description track (MP3 file)", "default": "\"\"", "attribute": "audio-description-source", "reflects": true }, { "kind": "field", "name": "audioDescriptionEnabled", "privacy": "public", "type": { "text": "boolean" }, "description": "Whether audio description is currently enabled", "default": "false", "attribute": "audio-description-enabled", "reflects": true }, { "kind": "field", "name": "t", "type": { "text": "object" }, "default": "{ ...this.t, embeddedMedia: \"embedded media\", gizmoTitle: \"Video\", gizmoDescription: \"Accessible video playback across multiple sources.\", tagAudioVideo: \"Media\", tagMedia: \"Media\", sourceTitle: \"Source\", sourceDescription: \"URL for this media.\", titleTitle: \"Title\", titleDescription: \"Title shown below the video.\", thumbnailTitle: \"Thumbnail image\", thumbnailDescription: \"Poster image URL.\", textTracksTitle: \"Text tracks\", textTracksDescription: \"Closed captions, subtitles, descriptions, and other text tracks for the video.\", trackFileTitle: \"Track file\", trackFileDescription: \"URL for the track file (WebVTT format).\", trackLabelTitle: \"Label\", trackLabelDescription: \"Label for the track (e.g., 'English', 'Spanish', 'Audio Description').\", trackLanguageCodeTitle: \"Language code\", trackLanguageCodeDescription: \"Two-letter language code (e.g., 'en', 'es', 'fr').\", trackTypeTitle: \"Track type\", trackTypeDescription: \"The type of text track.\", trackTypeSubtitles: \"Subtitles\", trackTypeCaptions: \"Captions\", trackTypeDescriptions: \"Descriptions\", trackTypeChapters: \"Chapters\", trackTypeMetadata: \"Metadata\", startTimeTitle: \"Start time\", startTimeDescription: \"Start video at a specific time (seconds).\", endTimeTitle: \"End time\", endTimeDescription: \"End video at a specific time (seconds), requires a start time.\", learningModeTitle: \"Enable learning mode\", learningModeDescription: \"Disables fast forward and rewind.\", hideYoutubeLinkTitle: \"Remove open on YouTube button\", hideYoutubeLinkDescription: \"Removes the button for opening the video on YouTube.\", linkableTitle: \"Include a share link?\", linkableDescription: \"Provides a link to share the video.\", hideTimestampsTitle: \"Hide timestamps\", hideTimestampsDescription: \"Hide the time stamps on the transcript.\", hideTranscriptTitle: \"Hide Transcript\", hideTranscriptDescription: \"Hide transcript by default.\", crossoriginTitle: \"Crossorigin\", crossoriginDescription: \"Indicates whether to use CORS.\", allowBackgroundPlayTitle: \"Allow background playback\", allowBackgroundPlayDescription: \"Keep playing when the browser tab loses focus.\", darkTranscriptTitle: \"Dark theme for transcript\", darkTranscriptDescription: \"Enable dark theme for the transcript.\", disableInteractiveTitle: \"Disable Interactive\", disableInteractiveDescription: \"Disable interactive mode that makes transcript clickable.\", languageTitle: \"Language\", languageDescription: \"Language of the media.\", accentColorTitle: \"Accent color\", accentColorDescription: \"(deprecated) Select the accent color for the player.\", copyTimecodeLabel: \"Copy current timecode\", englishLabel: \"English\", audioDescriptionLabel: \"Audio Description\", audioDescriptionTitle: \"Audio Description Track\", audioDescriptionDescription: \"URL to an audio description track (MP3 file) that provides narration of visual elements.\", }" }, { "kind": "field", "name": "accentColor", "privacy": "public", "type": { "text": "string" }, "description": "Optional accent color for controls,\nusing these colors:\n`red`, `pink`, `purple`, `deep-purple`, `indigo`, `blue`,\n`light-blue`, `cyan`, `teal`, `green`, `light-green`, `lime`,\n`yellow`, `amber`, orange, deep-orange, and brown.\nDefault is null.", "attribute": "accent-color", "reflects": true }, { "kind": "field", "name": "height", "privacy": "public", "type": { "text": "string" }, "description": "Height of media player.", "attribute": "height" }, { "kind": "field", "name": "id", "privacy": "public", "type": { "text": "string" }, "description": "Unique id", "attribute": "id", "reflects": true }, { "kind": "field", "name": "mediaTitle", "privacy": "public", "type": { "text": "string" }, "description": "Simple caption for video", "attribute": "media-title", "reflects": true }, { "kind": "field", "name": "track", "privacy": "public", "type": { "text": "string" }, "description": "Url for a single subtitle track", "attribute": "track" }, { "kind": "field", "name": "thumbnailSrc", "privacy": "public", "type": { "text": "string" }, "description": "Source of optional thumbnail image", "attribute": "thumbnail-src", "reflects": true }, { "kind": "field", "name": "width", "privacy": "public", "type": { "text": "string" }, "description": "Width of media player for non-a11y-media.", "attribute": "width" } ], "attributes": [ { "name": "sourceType", "type": { "text": "string" }, "default": "\"\"", "fieldName": "sourceType" }, { "name": "accent-color", "type": { "text": "string" }, "description": "Optional accent color for controls,\nusing these colors:\n`red`, `pink`, `purple`, `deep-purple`, `indigo`, `blue`,\n`light-blue`, `cyan`, `teal`, `green`, `light-green`, `lime`,\n`yellow`, `amber`, orange, deep-orange, and brown.\nDefault is null.", "fieldName": "accentColor" }, { "name": "crossorigin", "type": { "text": "string" }, "description": "Cross origin flag for transcripts to load", "default": "\"anonymous\"", "fieldName": "crossorigin" }, { "name": "dark", "type": { "text": "boolean" }, "description": "Enables darker player.", "default": "false", "fieldName": "dark" }, { "name": "darkTranscript", "type": { "text": "boolean" }, "description": "Use dark theme on transcript? Default is false, even when player is dark.", "default": "false", "fieldName": "darkTranscript" }, { "name": "disableInteractive", "type": { "text": "boolean" }, "description": "disable interactive mode that makes transcript clickable", "default": "false", "fieldName": "disableInteractive" }, { "name": "height", "type": { "text": "string" }, "description": "Height of media player.", "fieldName": "height" }, { "name": "hide-timestamps", "type": { "text": "boolean" }, "description": "show cue's start and end time", "default": "false", "fieldName": "hideTimestamps" }, { "name": "hide-transcript", "type": { "text": "boolean" }, "description": "Hide transcript by default", "default": "false", "fieldName": "hideTranscript" }, { "name": "id", "type": { "text": "string" }, "description": "Unique id", "fieldName": "id" }, { "name": "learning-mode", "type": { "text": "boolean" }, "description": "Learning mode", "default": "false", "fieldName": "learningMode" }, { "name": "lang", "type": { "text": "string" }, "description": "Language of media", "default": "\"en\"", "fieldName": "lang" }, { "name": "linkable", "type": { "text": "boolean" }, "description": "Include a share link?", "default": "false", "fieldName": "linkable" }, { "name": "media-title", "type": { "text": "string" }, "description": "Simple caption for video", "fieldName": "mediaTitle" }, { "name": "hide-youtube-link", "type": { "text": "boolean" }, "description": "Open on YouTube button", "default": "false", "fieldName": "hideYoutubeLink" }, { "name": "source", "type": { "text": "string" }, "description": "Single sources of video", "default": "\"\"", "fieldName": "source" }, { "name": "sources", "type": { "text": "array" }, "description": "Array of multiple video sources", "default": "[]", "fieldName": "sources" }, { "name": "sourceData", "type": { "text": "object" }, "description": "Source properties and slotted sources", "readonly": true, "return": { "type": { "text": "Array" } }, "fieldName": "sourceData" }, { "name": "sticky-corner", "type": { "text": "string" }, "description": "When playing but scrolled off screen, to which corner does it \"stick\":\n`top-left`, `top-right`, `bottom-left`, `bottom-right`, or `none`?\nDefault is `top-right`. `None` disables stickiness.", "default": "\"none\"", "fieldName": "stickyCorner" }, { "name": "track", "type": { "text": "string" }, "description": "Url for a single subtitle track", "fieldName": "track" }, { "name": "tracks", "type": { "text": "array" }, "description": "Array of text tracks, eg. `[{ \"src\": \"path/to/track.vtt\", \"label\": \"English\", \"srclang\": \"en\", \"kind\": \"subtitles\", }]`", "default": "[]", "fieldName": "tracks" }, { "name": "thumbnail-src", "type": { "text": "string" }, "description": "Source of optional thumbnail image", "fieldName": "thumbnailSrc" }, { "name": "width", "type": { "text": "string" }, "description": "Width of media player for non-a11y-media.", "fieldName": "width" }, { "name": "playing", "type": { "text": "boolean" }, "description": "Data reactivity for play status from a11y-media-player", "default": "false", "fieldName": "playing" }, { "name": "allow-background-play", "type": { "text": "boolean" }, "description": "Option to allow playing while not active tab", "default": "false", "fieldName": "allowBackgroundPlay" }, { "name": "start-time", "type": { "text": "null" }, "description": "Start time for video", "default": "null", "fieldName": "startTime" }, { "name": "end-time", "type": { "text": "null" }, "description": "End time for video", "default": "null", "fieldName": "endTime" }, { "name": "audio-description-source", "type": { "text": "string" }, "description": "URL to audio description track (MP3 file)", "default": "\"\"", "fieldName": "audioDescriptionSource" }, { "name": "audio-description-enabled", "type": { "text": "boolean" }, "description": "Whether audio description is currently enabled", "default": "false", "fieldName": "audioDescriptionEnabled" } ], "mixins": [ { "name": "IntersectionObserverMixin", "package": "@haxtheweb/intersection-element/lib/IntersectionObserverMixin.js" }, { "name": "MediaBehaviorsVideo", "package": "@haxtheweb/media-behaviors/media-behaviors.js" }, { "name": "SchemaBehaviors", "package": "@haxtheweb/schema-behaviors/schema-behaviors.js" }, { "name": "I18NMixin", "package": "@haxtheweb/i18n-manager/lib/I18NMixin.js" } ], "superclass": { "name": "DDD", "package": "@haxtheweb/d-d-d/d-d-d.js" }, "tagName": "video-player", "customElement": true } ], "exports": [ { "kind": "custom-element-definition", "declaration": { "name": "VideoPlayer", "module": "video-player.js" } }, { "kind": "js", "name": "VideoPlayer", "declaration": { "name": "VideoPlayer", "module": "video-player.js" } } ] }, { "kind": "javascript-module", "path": "lib/lecture-anchor.js", "declarations": [ { "kind": "class", "description": "", "name": "LectureAnchor", "members": [ { "kind": "method", "name": "clickHandler", "parameters": [ { "name": "e" } ] }, { "kind": "field", "name": "tag", "static": true, "readonly": true }, { "kind": "field", "name": "value", "privacy": "public", "type": { "text": "number" }, "static": true, "readonly": true, "default": "0", "attribute": "value", "reflects": true }, { "kind": "field", "name": "jumbotronHeading", "static": true, "readonly": true, "type": { "text": "string" }, "default": "\"\"" }, { "kind": "field", "name": "jumbotronContent", "static": true, "readonly": true, "type": { "text": "string" }, "default": "\"\"" }, { "kind": "field", "name": "icon", "privacy": "public", "type": { "text": "string" }, "default": "\"icons:flag\"", "attribute": "icon", "reflects": true }, { "kind": "field", "name": "target", "privacy": "public", "type": { "text": "string" }, "default": "\"video-player\"", "attribute": "target", "reflects": true }, { "kind": "field", "name": "associatedID", "privacy": "public", "type": { "text": "string" }, "default": "\"\"", "attribute": "associatedID", "reflects": true } ], "attributes": [ { "name": "icon", "type": { "text": "string" }, "default": "\"icons:flag\"", "fieldName": "icon" }, { "name": "value", "type": { "text": "number" }, "readonly": true, "default": "0", "fieldName": "value" }, { "name": "target", "type": { "text": "string" }, "default": "\"video-player\"", "fieldName": "target" }, { "name": "associatedID", "type": { "text": "string" }, "default": "\"\"", "fieldName": "associatedID" } ], "superclass": { "name": "DDD", "package": "@haxtheweb/d-d-d/d-d-d.js" }, "tagName": "lecture-anchor", "customElement": true } ], "exports": [ { "kind": "custom-element-definition", "name": "lecture-anchor", "declaration": { "name": "LectureAnchor", "module": "lib/lecture-anchor.js" } } ] }, { "kind": "javascript-module", "path": "lib/lecture-player.js", "declarations": [ { "kind": "class", "description": "", "name": "LecturePlayer", "members": [ { "kind": "method", "name": "setJumbotronAttributes" }, { "kind": "method", "name": "getNextSiblingHTML", "parameters": [ { "name": "element" } ] }, { "kind": "method", "name": "addPrevNextListeners" }, { "kind": "method", "name": "updateJumbotron" }, { "kind": "method", "name": "updatePlaylist" }, { "kind": "method", "name": "seek", "parameters": [ { "name": "timestamp" } ] }, { "kind": "method", "name": "play" }, { "kind": "method", "name": "checkDisabledButtons" }, { "kind": "method", "name": "endVideo" }, { "kind": "method", "name": "showModal" }, { "kind": "field", "name": "associatedNodes", "privacy": "public", "type": { "text": "object" }, "default": "new Object()", "attribute": "associatedNodes", "reflects": true }, { "kind": "field", "name": "videoPlayer" }, { "kind": "field", "name": "videoInterval", "type": { "text": "null" }, "default": "null" }, { "kind": "field", "name": "activeIndex", "privacy": "public", "type": { "text": "null" }, "default": "null", "attribute": "activeIndex", "reflects": true }, { "kind": "field", "name": "t", "type": { "text": "object" }, "default": "{ ...this.t, missingTitle: \"Missing Title\", closeLecturePlayer: \"Close Lecture Player\", openLecturePlayer: \"Open Lecture Player\", }" }, { "kind": "field", "name": "source", "privacy": "public", "type": { "text": "string" }, "attribute": "source", "reflects": true }, { "kind": "field", "name": "open", "privacy": "public", "type": { "text": "boolean" }, "attribute": "open", "reflects": true } ], "attributes": [ { "name": "activeIndex", "type": { "text": "null" }, "default": "null", "fieldName": "activeIndex" }, { "name": "source", "type": { "text": "string" }, "fieldName": "source" }, { "name": "associatedNodes", "type": { "text": "object" }, "default": "new Object()", "fieldName": "associatedNodes" }, { "name": "open", "type": { "text": "boolean" }, "fieldName": "open" } ], "mixins": [ { "name": "I18NMixin", "package": "@haxtheweb/i18n-manager/lib/I18NMixin.js" }, { "name": "DDDSuper", "package": "@haxtheweb/d-d-d/d-d-d.js" } ], "superclass": { "name": "LitElement", "package": "lit" }, "tagName": "lecture-player", "customElement": true } ], "exports": [ { "kind": "custom-element-definition", "name": "lecture-player", "declaration": { "name": "LecturePlayer", "module": "lib/lecture-player.js" } } ] } ] }