|
189 | 189 | // 3. "popup" - Automatically generated, written to a draggable, resizable popup window that can be toggled on/off with a button |
190 | 190 | // If data-include-transcript="false", there is no "popup" transcript |
191 | 191 |
|
| 192 | + if ($(media).data('transcript-div') !== undefined && $(media).data('transcript-div') !== "") { |
| 193 | + this.transcriptDivLocation = $(media).data('transcript-div'); |
| 194 | + } |
| 195 | + else { |
| 196 | + this.transcriptDivLocation = null; |
| 197 | + } |
| 198 | + if ($(media).data('include-transcript') !== undefined && $(media).data('include-transcript') === false) { |
| 199 | +console.log('YOU WANT TO HIDE TRANSCRIPT BUTTON'); |
| 200 | + this.hideTranscriptButton = true; |
| 201 | + } |
| 202 | + else { |
| 203 | +console.log('YOU DO NOT WANT TO HIDE TRANSCRIPT BUTTON'); |
| 204 | + this.hideTranscriptButton = null; |
| 205 | + } |
| 206 | + |
192 | 207 | this.transcriptType = null; |
193 | 208 | if ($(media).data('transcript-src') !== undefined) { |
194 | 209 | this.transcriptSrc = $(media).data('transcript-src'); |
|
198 | 213 | } |
199 | 214 | else if ($(media).find('track[kind="captions"], track[kind="subtitles"]').length > 0) { |
200 | 215 | // required tracks are present. COULD automatically generate a transcript |
201 | | - if ($(media).data('transcript-div') !== undefined && $(media).data('transcript-div') !== "") { |
202 | | - this.transcriptDivLocation = $(media).data('transcript-div'); |
| 216 | + if (this.transcriptDivLocation) { |
203 | 217 | this.transcriptType = 'external'; |
204 | 218 | } |
205 | | - else if ($(media).data('include-transcript') !== undefined) { |
206 | | - if ($(media).data('include-transcript') !== false) { |
207 | | - this.transcriptType = 'popup'; |
208 | | - } |
209 | | - } |
210 | 219 | else { |
211 | 220 | this.transcriptType = 'popup'; |
212 | 221 | } |
213 | 222 | } |
| 223 | +console.log('transcriptType: ' + this.transcriptType); |
| 224 | +console.log('transcriptDivLocation: ' + this.transcriptDivLocation); |
| 225 | +console.log('hideTranscriptButton: ' + this.hideTranscriptButton); |
| 226 | + |
214 | 227 |
|
215 | 228 | // In "Lyrics Mode", line breaks in WebVTT caption files are supported in the transcript |
216 | 229 | // If false (default), line breaks are are removed from transcripts in order to provide a more seamless reading experience |
|
3873 | 3886 | bll.push('descriptions'); //audio description |
3874 | 3887 | } |
3875 | 3888 | } |
3876 | | - if (this.transcriptType === 'popup') { |
| 3889 | + if (this.transcriptType === 'popup' && !(this.hideTranscriptButton)) { |
3877 | 3890 | bll.push('transcript'); |
3878 | 3891 | } |
3879 | 3892 |
|
@@ -10278,7 +10291,12 @@ if (thisObj.useTtml && (trackSrc.endsWith('.xml') || trackText.startsWith('<?xml |
10278 | 10291 | if (!this.transcriptType) { |
10279 | 10292 | // previously set transcriptType to null since there are no <track> elements |
10280 | 10293 | // check again to see if captions have been collected from other sources (e.g., YouTube) |
| 10294 | +console.log("there is no transcriptType yet"); |
| 10295 | +console.log('captions length: ' + this.captions.length); |
| 10296 | +console.log('usingYouTubeCaptions: ' + this.usingYouTubeCaptions); |
| 10297 | + |
10281 | 10298 | if (this.captions.length && (!(this.usingYouTubeCaptions || this.usingVimeoCaptions))) { |
| 10299 | +console.log('captions are possible!'); |
10282 | 10300 | // captions are possible! Use the default type (popup) |
10283 | 10301 | // if other types ('external' and 'manual') were desired, transcriptType would not be null here |
10284 | 10302 | this.transcriptType = 'popup'; |
|
0 commit comments