hoyois / clicktoplugin

Prevents plug-ins from loading automatically in Safari
http://hoyois.github.com/safariextensions/clicktoplugin/
228 stars 44 forks source link

ClickToPlugin does not work on Udacity (which uses Youtube) #160

Closed nick-s-b closed 8 years ago

nick-s-b commented 8 years ago

Hi all,

Absolutely love ClickToPlugin and have used it for years and years. It's a godsend to me because it replaces various video players and gives you options so you can control the behavior of online videos.

Anyway, I signed up for a free Udacity course and they use YT to host their videos. All of their videos are on YT but are marked as private so you can't find them through search and there's no playlists so the only way to watch them is through their website.

Embedded YT player on Udacity autoplays and there's no option to save any of the videos (you have to manually dig out the URL of the video to save it). YT also serves HTML5 player by default (enabling/disabling Flash does nothing).

Does anyone know how to get ClickToPlugin to replace YT's embedded player on Udacity?

Thank you!

hoyois commented 8 years ago

What is the URL of the iframe? The one that starts with www.youtube.com/embed/.

nick-s-b commented 8 years ago

@hoyois It looks like this:

<iframe id="widget2" src="https://www.youtube.com/embed/iF8dRePlPUo?autoplay=1&amp;color=red&amp;controls=1&amp;rel=0&amp;showinfo=0&amp;fs=1&amp;theme=light&amp;wmode=opaque&amp;html5=1&amp;enablejsapi=1&amp;origin=https%3A%2F%2Fwww.udacity.com" title="YouTube video player" allowfullscreen="1" class="ng-scope" data-ng-controller="videoPlayer" width="930" frameborder="0" height="523"></iframe>

For some reason, C2P is not replacing this iframe.

Thanks for looking into it Marc!

hoyois commented 8 years ago

It's because it has html5=1 as a parameter. The YouTube killer checks for this and only forces Flash when html5 is not explicitly requested. The only way around it is to use a custom YouTube killer which removes this check.

nick-s-b commented 8 years ago

@hoyois Marc, could this be added as an option/preference somewhere? I don't have Apple cert so I can't sign a modified extension myself. Some of these HTML5 players are even more annoying than some of the plugins ;). Thanks.

hoyois commented 8 years ago

You don't need to compile the extension. I've uploaded an alternative YouTube killer that should do what you want: https://raw.githubusercontent.com/hoyois/plugin-to-html5/master/YouTube-force-flash.js Simply replace the internal URL with this one in the list of killers. You can also put it on your local server.

The extension is not designed to have preferences for killers. Instead, it allows arbitrary customization of killers.

nick-s-b commented 8 years ago

THANK YOU Marc!!!