|
2275 | 2275 | cut(state, 1); |
2276 | 2276 | var components = act(state, getCuePayload); |
2277 | 2277 |
|
| 2278 | + if (typeof cueId === 'undefined') { |
| 2279 | + cueId = state.cues.length + 1; |
| 2280 | + } |
| 2281 | + |
2278 | 2282 | state.cues.push({ |
2279 | 2283 | id: cueId, |
2280 | 2284 | start: startTime, |
|
2964 | 2968 |
|
2965 | 2969 | var thisObj, headingLevel, headingType, headingId, $chaptersHeading, |
2966 | 2970 | $chaptersNav, $chaptersList, $chapterItem, $chapterButton, |
2967 | | - i, itemId, chapter, buttonId, hasDefault, |
| 2971 | + i, chapter, buttonId, hasDefault, |
2968 | 2972 | getClickFunction, $clickedItem, $chaptersList, thisChapterIndex; |
2969 | 2973 |
|
2970 | 2974 | thisObj = this; |
|
2996 | 3000 | $chaptersList = $('<ul>'); |
2997 | 3001 | for (i in this.chapters) { |
2998 | 3002 | chapter = this.chapters[i]; |
2999 | | - itemId = this.mediaId + '-chapters-' + i; // TODO: Maybe not needed??? |
3000 | 3003 | $chapterItem = $('<li></li>'); |
3001 | 3004 | $chapterButton = $('<button>',{ |
3002 | 3005 | 'type': 'button', |
|
4878 | 4881 | var playerState = thisObj.getPlayerState(x.data); |
4879 | 4882 | if (playerState === 'playing') { |
4880 | 4883 | thisObj.playing = true; |
| 4884 | + thisObj.startedPlaying = true; |
4881 | 4885 | } |
4882 | 4886 | else { |
4883 | 4887 | thisObj.playing = false; |
|
5195 | 5199 | for (var i=0; i<options.length; i++) { |
5196 | 5200 | if (options[i] == 'cc') { // this is the AS3 (Flash) player |
5197 | 5201 | this.ytCaptionModule = 'cc'; |
5198 | | - this.hasCaptions = true; |
5199 | | - this.usingYouTubeCaptions = true; |
| 5202 | + if (!this.hasCaptions) { |
| 5203 | + // there are captions available via other sources (e.g., <track>) |
| 5204 | + // so use these |
| 5205 | + this.hasCaptions = true; |
| 5206 | + this.usingYouTubeCaptions = true; |
| 5207 | + } |
5200 | 5208 | break; |
5201 | 5209 | } |
5202 | 5210 | else if (options[i] == 'captions') { // this is the HTML5 player |
5203 | 5211 | this.ytCaptionModule = 'captions'; |
5204 | | - this.hasCaptions = true; |
5205 | | - this.usingYouTubeCaptions = true; |
| 5212 | + if (!this.hasCaptions) { |
| 5213 | + // there are captions available via other sources (e.g., <track>) |
| 5214 | + // so use these |
| 5215 | + this.hasCaptions = true; |
| 5216 | + this.usingYouTubeCaptions = true; |
| 5217 | + } |
5206 | 5218 | break; |
5207 | 5219 | } |
5208 | | - else { |
5209 | | - // no recognizable caption module was found |
5210 | | - // sorry, gonna have to disable captions if we can't control them |
5211 | | - this.hasCaptions = false; |
5212 | | - this.usingYouTubeCaptions = false; |
5213 | | - } |
5214 | 5220 | } |
5215 | 5221 | if (typeof this.ytCaptionModule !== 'undefined') { |
5216 | 5222 | if (this.usingYouTubeCaptions) { |
|
7491 | 7497 | }; |
7492 | 7498 |
|
7493 | 7499 | AblePlayer.prototype.handleChapters = function () { |
7494 | | - |
7495 | 7500 | if (this.hidingPopup) { |
7496 | 7501 | // stopgap to prevent spacebar in Firefox from reopening popup |
7497 | 7502 | // immediately after closing it |
|
8879 | 8884 | }; |
8880 | 8885 |
|
8881 | 8886 | AblePlayer.prototype.highlightTranscript = function (currentTime) { |
| 8887 | + |
| 8888 | + //show highlight in transcript marking current caption |
| 8889 | + |
8882 | 8890 | if (!this.transcriptType) { |
8883 | 8891 | return; |
8884 | 8892 | } |
8885 | 8893 |
|
8886 | | - //show highlight in transcript marking current caption |
8887 | 8894 | var start, end; |
8888 | 8895 | var thisObj = this; |
8889 | 8896 |
|
|
0 commit comments