Comments (11)
I've noticed more issues with youtube urls as follows:
> auto_html("http://www.youtube-nocookie.com/embed/t7NdBIA4zJg") {youtube;}
=> "http://www.youtube-nocookie.com/embed/t7NdBIA4zJg"
> auto_html("http://www.youtube-nocookie.com/v/t7NdBIA4zJg") {youtube;}
=> "http://www.youtube-nocookie.com/embed/t7NdBIA4zJg"
> auto_html("http://www.youtube.com/embed/t7NdBIA4zJg") {youtube;}
=> "http://www.youtube-nocookie.com/embed/t7NdBIA4zJg"
> auto_html("http://www.youtube.com/v/t7NdBIA4zJg") {youtube;}
=> "http://www.youtube-nocookie.com/embed/t7NdBIA4zJg"
These are all valid youtube urls. The domain youtube-nocookie.com is available as an option on youtube.com when embedding a video.
from auto_html.
Another issue (note the params at the end, outside the iframe):
> auto_html("http://youtu.be/t7NdBIA4zJg?t=1s&hd=1") {youtube;}
=> "<iframe class=\"youtube-player\" type=\"text/html\" width=\"390\" height=\"250\" src=\"http://www.youtube.com/embed/t7NdBIA4zJg\" frameborder=\"0\">\n</iframe>?t=1s&hd=1"
from auto_html.
Another issue (the params are lost):
> auto_html("http://www.youtube.com/watch?v=t7NdBIA4zJg&t=1m1s&rel=0&hd=1") {youtube;}
=> "<iframe class=\"youtube-player\" type=\"text/html\" width=\"390\" height=\"250\" src=\"http://www.youtube.com/embed/t7NdBIA4zJg\" frameborder=\"0\">\n</iframe>"
Hopefully this is helpful and not annoying :)
I'm hoping to use auto_html to process user input, so the url could be in any format.
from auto_html.
It also doesn't support short youtube urls like "http://youtu.be/t9sFUH-HTUc".
from auto_html.
youtu.be links work for me:
> auto_html("http://youtu.be/t9sFUH-HTUc") {youtube;}
=> "<iframe class=\"youtube-player\" type=\"text/html\" width=\"390\" height=\"250\" src=\"http://www.youtube.com/embed/t9sFUH-HTUc\" frameborder=\"0\">\n</iframe>"
from auto_html.
Ah, sorry. My bad.
from auto_html.
Yeah, youtu.be works in 1.4.2.
@sheldond thank you for listing these issues, I'll have them fix soon.
from auto_html.
Here's a regex that may be helpful, taken from https://github.com/rgrove/sanitize
/\Ahttps?:\/\/(?:www\.)?youtube(?:-nocookie)?\.com\//
from auto_html.
The following also fails to be properly digested by auto_html:
http://www.youtube.com/watch?feature=player_embedded&v=l7AWnfFRc7g
from auto_html.
Over a year later, but I'm also seeing issues with 1.6.4:
No go with youtu.be
, nor any https://
urls.
from auto_html.
Thanks for writing this library. I'm also hoping to use it in a project. However I'm having the same problem with embedding https
video URLs. The unit test for correct conversion of an https URL into an embedded youtube link seems to work though.
from auto_html.
Related Issues (20)
- Soundcloud filter HOT 2
- Create an org for this gem? HOT 4
- Use this w/o DB worries. No strings attached. HOT 1
- Naming Convention HOT 1
- NameError: uninitialized constant HTML after upgrading to Rails 4.2.4 HOT 9
- Add facebook video filter HOT 3
- vimeo shows the link only HOT 1
- With new api is there a way to use old syntax auto_html_for or equivalent? HOT 1
- Why was the documentation changed? HOT 1
- Will Facebook videos be incorporated? HOT 1
- Is there a way to create thumbnail images from the video URL? HOT 2
- undefined method `auto_html_for' HOT 3
- In case of image + emoji it is not working HOT 2
- What happened to Rails integration? HOT 4
- will_paginate-bootstrap is broken auto_html HOT 3
- Rails5 deprecation warning HOT 2
- youtube_js_api returns 404 HOT 1
- undefined method `add_filter' for AutoHtml:Module (NoMethodError) HOT 1
- Where can I find the emoji image library? HOT 1
- Want to be able to autolink short domains HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto_html.