Re: Rewriting YouTube's Flash video embedding code to use HTML video?

2015-08-24 Thread Ehsan Akhgari

On 2015-08-21 6:17 PM, Chris Peterson wrote:

Does Gecko have a precedent for rewriting certain HTML patterns? YouTube
is migrating from Flash to HTML video, but many third-party websites
copied YouTube's old example code to embedded Flash videos. YouTube's
current embedding code automatically switches between Flash and HTML
video, but YouTube can't fix third-party websites still using the old
embedding code.

Bug 769117 discusses whether Gecko should detect YouTube's old embedding
boilerplate and automatically rewrite it to use the current code.
Firefox and Safari extensions [1] [2] already do this, but should Gecko
include this feature directly? It would improve users' video experience
and fix dead links if/when Firefox or YouTube stop supporting Flash.
OTOH, this is a site-specific workaround and thus might not belong in
Gecko itself.


We have done a site specific workaround in the past for hotmail that we 
almost shipped https://bugzilla.mozilla.org/show_bug.cgi?id=627729, so 
there is prior art here.


I think that for the specific case at hand, it does make sense to add a 
site-specific workaround, since I think that the user facing benefit 
trumps the technical purity.


___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Rewriting YouTube's Flash video embedding code to use HTML video?

2015-08-24 Thread Chris Peterson

On 8/24/15 9:43 AM, Ehsan Akhgari wrote:

We have done a site specific workaround in the past for hotmail that we
almost shipped https://bugzilla.mozilla.org/show_bug.cgi?id=627729, so
there is prior art here.

I think that for the specific case at hand, it does make sense to add a
site-specific workaround, since I think that the user facing benefit
trumps the technical purity.


Thanks. I'll take a look. We're working with YouTube and they see these 
third-party sites as a problem, too.


chris
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Rewriting YouTube's Flash video embedding code to use HTML video?

2015-08-22 Thread Mike Taylor

On 8/21/15 6:31 PM, Hubert Figuière wrote:

On 21/08/15 06:17 PM, Chris Peterson wrote:

Bug 769117 discusses whether Gecko should detect YouTube's old embedding
boilerplate and automatically rewrite it to use the current code.
Firefox and Safari extensions [1] [2] already do this, but should Gecko
include this feature directly? It would improve users' video experience
and fix dead links if/when Firefox or YouTube stop supporting Flash.
OTOH, this is a site-specific workaround and thus might not belong in
Gecko itself.


It think that it is a feature that could be implemented in Firefox:

1. make it so that the rules are rewritable without updating the
browser, or at least touching the core. ESR comes to mind as a reason
why we'd love to update these.


This sounds like a good use case for a system addon described by the 
Go Faster initiative. [1]



2. make it cross platform. Mobile (including FirefoxOS) would completely
benefit from that. Case in point, Safari on iOS has been doing that for
a very long time.


+1.

[1] 
https://wiki.mozilla.org/Firefox/Go_Faster#Project_1:_Ship_features_as_system_add-ons


--
Mike Taylor
Web Compat, Mozilla
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Rewriting YouTube's Flash video embedding code to use HTML video?

2015-08-21 Thread Chris Peterson
Does Gecko have a precedent for rewriting certain HTML patterns? YouTube 
is migrating from Flash to HTML video, but many third-party websites 
copied YouTube's old example code to embedded Flash videos. YouTube's 
current embedding code automatically switches between Flash and HTML 
video, but YouTube can't fix third-party websites still using the old 
embedding code.


Bug 769117 discusses whether Gecko should detect YouTube's old embedding 
boilerplate and automatically rewrite it to use the current code. 
Firefox and Safari extensions [1] [2] already do this, but should Gecko 
include this feature directly? It would improve users' video experience 
and fix dead links if/when Firefox or YouTube stop supporting Flash. 
OTOH, this is a site-specific workaround and thus might not belong in 
Gecko itself.



chris

[1] https://github.com/hfiguiere/no-flash/
[2] http://clicktoflash.com/
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Rewriting YouTube's Flash video embedding code to use HTML video?

2015-08-21 Thread Hubert Figuière
Disclaimer: I wrote the Firefox add-on mentioned, and I filed the bug
mentioned as well. So my opinion is sorta made.

On 21/08/15 06:17 PM, Chris Peterson wrote:
 Does Gecko have a precedent for rewriting certain HTML patterns? YouTube
 is migrating from Flash to HTML video, but many third-party websites
 copied YouTube's old example code to embedded Flash videos. YouTube's
 current embedding code automatically switches between Flash and HTML
 video, but YouTube can't fix third-party websites still using the old
 embedding code.
 
 Bug 769117 discusses whether Gecko should detect YouTube's old embedding
 boilerplate and automatically rewrite it to use the current code.
 Firefox and Safari extensions [1] [2] already do this, but should Gecko
 include this feature directly? It would improve users' video experience
 and fix dead links if/when Firefox or YouTube stop supporting Flash.
 OTOH, this is a site-specific workaround and thus might not belong in
 Gecko itself.

It think that it is a feature that could be implemented in Firefox:

1. make it so that the rules are rewritable without updating the
browser, or at least touching the core. ESR comes to mind as a reason
why we'd love to update these.

2. make it cross platform. Mobile (including FirefoxOS) would completely
benefit from that. Case in point, Safari on iOS has been doing that for
a very long time.

3. don't make it specific to YouTube but specific to Flash. no-flash
supports Dailymotion (the French YouTube) and Vimeo (rarer since they
have done HTML5 embed for even longer). With 1. we can add rules easily.

As for the question if Gecko has a feature, maybe that's where we
implement it. I'm not sure if that's a feature to expose in the wild or
not but given that we can do it with add-ons, and there are a few
concrete use cases, we can possibly think of making this of general
usefulness.

Just my CAD$0.02

Hub

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Rewriting YouTube's Flash video embedding code to use HTML video?

2015-08-21 Thread Hubert Figuière
On 21/08/15 07:52 PM, Chris Peterson wrote:

 2. make it cross platform. Mobile (including FirefoxOS) would completely
 benefit from that. Case in point, Safari on iOS has been doing that for
 a very long time.
 
 Do you know what Safari is rewriting? I assume it's more than just Flash
 videos.

It does a bit more, not sure exactly why.
This is on iOS 8.
For a Youtube video embedded in Flash, it replaces with the iframe, or a
reasonbly looking substitute. To that it also will put its own video
controller on video playback - losing the benefit of the rest of the
Youtube bells and whistle. This is not only for Youtube but for HTML5 in
general. Also I do believe they never autoplay (yay!)

Note that Apple made the choice to not show a Flash placeholder - just
empty space - which is IMHO bad.

Cheers,

Hub
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Rewriting YouTube's Flash video embedding code to use HTML video?

2015-08-21 Thread Chris Peterson

On 8/21/15 4:31 PM, Hubert Figuière wrote:

Disclaimer: I wrote the Firefox add-on mentioned, and I filed the bug
mentioned as well. So my opinion is sorta made.


Yes, thank you! :)



On 21/08/15 06:17 PM, Chris Peterson wrote:

Does Gecko have a precedent for rewriting certain HTML patterns? YouTube
is migrating from Flash to HTML video, but many third-party websites
copied YouTube's old example code to embedded Flash videos. YouTube's
current embedding code automatically switches between Flash and HTML
video, but YouTube can't fix third-party websites still using the old
embedding code.

Bug 769117 discusses whether Gecko should detect YouTube's old embedding
boilerplate and automatically rewrite it to use the current code.
Firefox and Safari extensions [1] [2] already do this, but should Gecko
include this feature directly? It would improve users' video experience
and fix dead links if/when Firefox or YouTube stop supporting Flash.
OTOH, this is a site-specific workaround and thus might not belong in
Gecko itself.


It think that it is a feature that could be implemented in Firefox:

1. make it so that the rules are rewritable without updating the
browser, or at least touching the core. ESR comes to mind as a reason
why we'd love to update these.

2. make it cross platform. Mobile (including FirefoxOS) would completely
benefit from that. Case in point, Safari on iOS has been doing that for
a very long time.


Do you know what Safari is rewriting? I assume it's more than just Flash 
videos.




3. don't make it specific to YouTube but specific to Flash. no-flash
supports Dailymotion (the French YouTube) and Vimeo (rarer since they
have done HTML5 embed for even longer). With 1. we can add rules easily.

As for the question if Gecko has a feature, maybe that's where we
implement it. I'm not sure if that's a feature to expose in the wild or
not but given that we can do it with add-ons, and there are a few
concrete use cases, we can possibly think of making this of general
usefulness.


Good point. It could be a general pattern-matching/rewriting API 
available to add-ons. Regular expressions are part of the reason Adblock 
Plus is slow. We could move that matching into native code.



chris


___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform