Bug in video:: macro?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in video:: macro?

harrison
Hey all--
Question about the video:: macro (http://asciidoctor.org/docs/user-manual/#youtube-and-vimeo-videos)

I am seeing it generate youtube video urls that do not have the protocol ('http') on the front.

So the iframe it generates ends up looking like:

<iframe src="//www.youtube.com/embed/VIDEO_ID?rel=0" frameborder="0" allowfullscreen></iframe>

but because the src doesn't have the protocol on it, it doesn't work (chrome assumes you want file: instead of http:)

Any thoughts on how to get AsciiDoctor to do the right thing?

Thanks,
Harrison
Reply | Threaded
Open this post in threaded view
|

Re: Bug in video:: macro?

mojavelinux
Administrator
Harrison,

This is one of the annoying things about the YouTube embed script. The script requires that you use the schema-less URL. Otherwise, it won't work on the web. However, as you have observed, Chrome doesn't know how to handle it correctly for local files. Firefox manages to get it right (if "right" is the correct way to describe it).

The way you can preview the embedded YouTube video locally is to run a simple web server on the folder. You can do that in Python using:

python3 -m http.server

or in Ruby using:

ruby -run -e httpd . -p 8000

Unfortunately, I don't know of another way to make it work without YouTube changing their embed script.

We do, however, need to document this. I've filed an issue to ensure this information gets added.

https://github.com/asciidoctor/asciidoctor.org/issues/197

-Dan


On Thu, Nov 21, 2013 at 11:10 AM, harrison [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hey all--
Question about the video:: macro (http://asciidoctor.org/docs/user-manual/#youtube-and-vimeo-videos)

I am seeing it generate youtube video urls that do not have the protocol ('http') on the front.

So the iframe it generates ends up looking like:

<iframe src="//www.youtube.com/embed/VIDEO_ID?rel=0" frameborder="0" allowfullscreen></iframe>

but because the src doesn't have the protocol on it, it doesn't work (chrome assumes you want file: instead of http:)

Any thoughts on how to get AsciiDoctor to do the right thing?

Thanks,
Harrison


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Bug-in-video-macro-tp1041.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--