Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

www.bestbuy.com - “Geek Squad Services” video doesn’t play #5572

Closed
softvision-oana-arbuzov opened this issue Apr 10, 2017 · 10 comments
Closed
Labels
browser-firefox engine-gecko The browser uses the Gecko rendering engine
Milestone

Comments

@softvision-oana-arbuzov
Copy link
Member

softvision-oana-arbuzov commented Apr 10, 2017

URL: http://www.bestbuy.com/site/electronics/geek-squad/pcmcat138100050018.c?id=pcmcat138100050018
Browser / Version: Firefox Mobile Nightly 55.0a1 (2017-04-09)
Operating System: Android 6.0.1
Problem type: Video doesn't play

Steps to Reproduce

  1. Navigate to: http://www.bestbuy.com/site/electronics/geek-squad/pcmcat138100050018.c?id=pcmcat138100050018
  2. Tap “Watch a video about Geek Squad services”
  3. Tap to play the video.
  4. Observe behavior.

Expected Behavior:
Video plays.

Actual Behavior:
Video doesn’t play.

Note:

  1. Error page is displayed javascript:%20{%20var%20vid%20=%20document.getElementById('video_1943544786');%20if%20(firstTime)%20{vid.load();%20firstTime%20=%20false;}%20if%20(vid.paused)%20vid.play();%20else%20vid.pause();%20}
  2. Not reproducible on the Firefox 52.0 Release and Chrome (Mobile) 57.0.2987.132.
  3. Screenshot attached.

Watchers:
@softvision-sergiulogigan
@softvision-oana-arbuzov

sv; country: us

Screenshot Description

From webcompat.com with ❤️

@softvision-oana-arbuzov softvision-oana-arbuzov changed the title www.bestbuy.com - video doesn't play www.bestbuy.com - “Geek Squad Services” video doesn’t play Apr 10, 2017
@karlcow
Copy link
Member

karlcow commented Apr 11, 2017

Confirmed.
Moving to needsdiagnosis.

@karlcow
Copy link
Member

karlcow commented Apr 11, 2017

The URL bar shows

javascript: { var vid = document.getElementById('video_1943544786'); if (firstTime) {vid.load(); firstTime = false;} if (vid.paused) vid.play(); else vid.pause(); }

<div style="position:relative; width:320px; height:180px;">
    <a href="javascript: { var vid = document.getElementById('video_1943544786'); if (firstTime) {vid.load(); firstTime = false;} if (vid.paused) vid.play(); else vid.pause(); }">
        <video id="video_1943544786" src="http://lcmob.net/1943544786&amp;mobile=true&amp;reporting=false"
            poster="http://ecdn.liveclicker.net/8079A8/origin/thumbnails/1937/1375934542_1_Flv_320x180_thumb_2.jpg"
            controls="controls" width="320" height="180">
            <track kind="subtitles" label="English" src="http://lcmob.net/1943544786&amp;subtitle=true&amp;lang=en">
            <track kind="subtitles" label="Español"
                src="http://lcmob.net/1943544786&amp;subtitle=true&amp;lang=es">
        </video>
    </a>
</div>

@karlcow
Copy link
Member

karlcow commented Apr 11, 2017

This is the content of the a.
While Blink seems to ignore the a and goes directly to the player, Firefox tries to interpret the a

@KushalGooljar
Copy link

KushalGooljar commented Apr 23, 2017

Would it have been better to use jQuery to handle the event instead? It is common practice to separate the content of HTML with action/behaviour.

Or instead of jQuery an onclick_ event handler would have been better.

@wisniewskit
Copy link
Member

wisniewskit commented Jul 18, 2017

They have this href on an anchor tag which has a video tag inside of it. Note that it lacks a return false at the end:

<a href="javascript: { var vid = document.getElementById('video_1943544786'); if (firstTime) {vid.load(); firstTime = false;} if (vid.paused) vid.play(); else vid.pause(); }">
  <video ... />
</a>

As such the browser is supposed to do the "default" action for that link, which in the case of Firefox and Safari is to open a new tab and "visit" the link. Edge and Chrome don't do so, and seem to just ignore the default action. (I'm not sure if MobileSafari does what desktop Safari does in this case).

One way or the other, adding the missing return false makes it work cross-browser:

<a href="javascript: { var vid = document.getElementById('video_1943544786'); if (firstTime) {vid.load(); firstTime = false;} if (vid.paused) vid.play(); else vid.pause(); return false; }">
  <video ... />
</a>

I'll try to figure out if Chrome and Edge are being "clever" for cases like this with nested videos, or just treating all javascript: links as no-ops. But it's something that BestBuy should fix on their end regardless.

@wisniewskit
Copy link
Member

wisniewskit commented Jul 18, 2017

Actually no, I was wrong. Safari does seem to be handling things as Chrome and Edge do. It seems like this is specific to the javascript: link trying to load() the video, as removing that un-breaks the code (but it also breaks being able to play the video). I'm continuing my investigation here (but the fix I proposed still holds).

@wisniewskit
Copy link
Member

wisniewskit commented Jul 18, 2017

It does seem to be the case that Firefox is currently breaking javascript: links of this form unless they handle their play() promises in some way. I've filed bug 1382035 to try to figure this out.

Edit: it seems to be triggered by getting a promise, but not handling it. It doesn't have to be a play() promise specifically. That's why return false works.

@adamopenweb
Copy link
Collaborator

Thanks @wisniewskit.

Let's start by reaching out to a couple developers over LinkedIn.

@adamopenweb
Copy link
Collaborator

Our contact has passed this report along to the appropriate team internally.

@karlcow karlcow added this to the sitewait milestone Oct 30, 2017
@miketaylr miketaylr added the engine-gecko The browser uses the Gecko rendering engine label Apr 30, 2019
@cipriansv cipriansv modified the milestones: sitewait, fixed Aug 19, 2019
@cipriansv
Copy link

After retesting the issue I confirm that the issue has been fixed. The video plays.

image

Tested with:
Browser / Version: Firefox Nightly 68.1a1 (2019-08-17), Firefox Preview 1.2.0 (Build #12181645)
Operating System: Huawei P10 (Android 8.0) - 1080 x 1920 pixels (~432 ppi pixel density)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser-firefox engine-gecko The browser uses the Gecko rendering engine
Projects
None yet
Development

No branches or pull requests

8 participants