asbplayer icon indicating copy to clipboard operation
asbplayer copied to clipboard

Expose subtitle timestamps as Anki fields (For embedding YouTube video in Anki card)

Open lazerstg opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. It would be great, if the timestamps of a subtile (start and end time) could be exposed as additional fields for Anki. This way it would be possible to embed a YouTube video into an Anki card and let it only play the desired timespan. It would be also helpful to have the video id instead of just the full URL as a separate field. However, this could also be done using JavaScript within the Anki card.

<iframe
    width="560"
    height="315"
    src="https://www.youtube.com/embed/{{id}}?start={{startSeconds}}&end={{endSeconds}}&autoplay=1"
    frameborder=0
       autoplay=1
/>

Describe the solution you'd like New fields: Start seconds, end seconds, YouTube video ID

Describe alternatives you've considered This is inspired by the youtube2anki plugin. However, it is difficult to use as it relies on the transcript rather than the subtitles (language not changable).

Additional context image

lazerstg avatar Jul 04 '24 18:07 lazerstg

I'm inclined to set the URL or Source fields to the embed URL to solve your use-case for the Anki card, but why do you want the video ID separately?

killergerbah avatar Jul 05 '24 16:07 killergerbah

Thank you for your reply :)

I'm inclined to set the URL or Source fields to the embed URL to solve your use-case for the Anki card

That would also be a great solution.

but why do you want the video ID separately?

That would be only necessary to compose the embed link like this: https://www.youtube.com/embed/{{id}}?start={{startSeconds}}&end={{endSeconds}} So it would not be required if the full embed URL was already included in the source field.

lazerstg avatar Jul 05 '24 21:07 lazerstg

This works well, but I was wondering if end={{endSeconds}} is really necessary?

It's really annoying to not be able to go forward in the video and I usually end up removing this part of the url before sending it to Anki, which is not that much of a problem, but I think like many users would have the same feel...

For example, the first link, you absolutely cannot go past that moment without removing end from the parameters. I think this is dumb by youtube, but I wouldn't expect them to ever change it.

https://www.youtube.com/embed/z7EZK9ndPkg?start=891&autoplay=1&end=895

https://www.youtube.com/embed/z7EZK9ndPkg?start=891&autoplay=1

Feel free to pushback on this, I understand the use-case for end=

bpwhelan avatar Sep 18 '24 17:09 bpwhelan