froala / wysiwyg-editor

The next generation Javascript WYSIWYG HTML Editor.
https://www.froala.com/wysiwyg-editor
Other
5.3k stars 672 forks source link

Unable to add yahoo video #873

Closed kotmatpockuh closed 8 years ago

kotmatpockuh commented 9 years ago

Nothing happens if i add this link: https://www.yahoo.com/movies/the-martian-trailer-221819568.html

btw (v1 too) you must add some validation, if user enter iframe code directly into link input, or such bug will happened:

http://prntscr.com/8u19fz (first normally entered into iframe, second: iframe into url)

kotmatpockuh commented 9 years ago

also, please add regex for rutube support (popular russian video hosting):

, {
    test_regex: /^.+(rutube.ru)\/[^_&]+/,
    url_regex: /(?:https?:\/\/)?(?:www\.)?(?:rutube\.ru)\/(?:video)?\/?(.+)/g,
    url_text: "//rutube.ru/play/embed/$1",
    html: '<iframe width="720" height="405" src="{url}" frameborder="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" allowtransparency="true"></iframe>'
  }

for yahoo you need to change regex to: test_regex: /^.+(screen.yahoo.com)\/[^_&]+/,

stefanneculai commented 9 years ago

Could you please post a URL from screen.yahoo.com that doesn't work with the current RegEx?

We have Youtube Screen in the list of providers but not Yahoo Movies. We'll add an regex for it. Thanks for the regex for Rutube. :+1:

kotmatpockuh commented 9 years ago

random yahoo video, for example https://screen.yahoo.com/ship-nfl-team-london-225808694.html

stefanneculai commented 8 years ago

Last commit fixes the iframe insert problem, corrects the Yahoo Videos regex and adds Rutube to the list of supported video providers.

Because of the way Yahoo Movies embed is implemented, it is not possible to insert Yahoo Movies by URL. The ID from the browser URL (https://www.yahoo.com/movies/bridge-of-spies-trailer-234456217.html) is different than the one which should be embedded (https://movies.yahoo.com/video/bridge-spies-trailer-155500527.html).