Open GreatWhiteJ opened 5 years ago
I'm having the same issue.
<iframe id="BcibhO9UTjM" src="https://www.youtube.com/embed/BcibhO9UTjM?enablejsapi=1" width="560" height="315" allowfullscreen="allowfullscreen"></iframe></p>
<div id="videoTranscriptBcibhO9UTjM" class="mmocVideoTranscript" data-language="en"></div>
Hi arrawlings. In the transcript part of your video, you need to add the data-name parameter (and make it blank) like this:
data-name=""
hope that helps.
Hi GreatWhiteJ. Amazing. Thought I'd already tried that. Thank you!
No luck with english... tried several different edits based on info above, any advice?
`
`
Hi @seanvosler. Short answer: The solution is already found by @GreatWhiteJ above. You must set data-name="" in your case. I've added another example to the code and you can see it live here: https://pfdk.github.io/modules/ytexample2.html
Long answer: So how can you know if data-name should be empty or not? If you turn on/off subtitles when playing a youtube video, you will see in the network inspector that the browser fetches a link like this for your video:
Notice the lang=en parameter. This is what you need to specify as the data-language parameter, i.e. data-language="en"
In the case of my example video, the url being fetched is: https://www.youtube.com/api/timedtext?v=Lm0m4VtZ3Us&asr_langs=de%2Cen%2Ces%2Cfr%2Cit%2Cja%2Cko%2Cnl%2Cpt%2Cru&caps=asr&exp=xftt&xorp=true&xoaf=5&hl=en&ip=0.0.0.0&ipbits=0&expire=1623990758&sparams=ip%2Cipbits%2Cexpire%2Cv%2Casr_langs%2Ccaps%2Cexp%2Cxorp%2Cxoaf&signature=2491BA76C97C4BE14D1C6998144BCBF4D4D7B46E.31E20E3938D9530A917F046555EE8C78D5AFE5E2&key=yt8&lang=no&name=bokm%C3%A5l&fmt=json3&xorb=2&xobt=3&xovt=3
Notice the name=bokm%C3%A5l parameter. I am not exactly sure when the name parameter is present. But I think it has to do with how subtitles have been added to the video.
Hope that helps!
Hi. this is a fantastic idea, but the only video transcript i can seem to add to my page is the one from the example.
Admittedly, I'm web novice, so it's probably something super simple.
I've changed all 3 id from the example id to a new youtube ID. the language element has been shifted to English and the language divider has been deleted, without any other modifications, as instructed..
here's my code for a khan academy video in English
What am i missing?