and then, lity builds a url below which includes %3F as an urlencoded result of ? in matches[5] so that YouTube does not start the movie at 4394.
https://www.youtube.com/embed/WJ88GhJJI3Q?autoplay=1&%3Fstart=4394
So,
var _youtubeRegex = /(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i;
should be
var _youtubeRegex = /(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})\?(.*)?/i;
for the expected behavior.
Hi @nekoshippo, I'm interested in merging this into my "vanilla js" fork at https://github.com/naton/lity but unsure how to proceed. Any suggestions? Rebase this to my master there maybe?
When
<a href="//youtu.be/WJ88GhJJI3Q?start=4394" data-lity>Link</a>
is fired, var matches in lity.js is filled asand then, lity builds a url below which includes
%3F
as an urlencoded result of?
inmatches[5]
so that YouTube does not start the movie at 4394.https://www.youtube.com/embed/WJ88GhJJI3Q?autoplay=1&%3Fstart=4394
So,
var _youtubeRegex = /(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i;
should bevar _youtubeRegex = /(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})\?(.*)?/i;
for the expected behavior.