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

The js error when click on video thumbnail in product gallery fullscreen mode #36456

Closed
1 of 5 tasks
glevhen opened this issue Nov 10, 2022 · 19 comments · Fixed by #36578 · May be fixed by glevhen/magento2#1
Closed
1 of 5 tasks

The js error when click on video thumbnail in product gallery fullscreen mode #36456

glevhen opened this issue Nov 10, 2022 · 19 comments · Fixed by #36578 · May be fixed by glevhen/magento2#1
Assignees
Labels
Area: Admin UI Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.4-p2 Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@glevhen
Copy link

glevhen commented Nov 10, 2022

Preconditions and environment

  • Magento version: 2.4.4-p2

Steps to reproduce

  1. open on the storefront the product page which has video in product gallery
  2. click on the product image to open the gallery fullscreen mode
  3. click on the product video thumbnail

Expected result

the product video will autoplay and no errors in browser console

Actual result

the js error will appear in the browser console and video will not autoplay

fotorama-add-video-events.js:605 
Uncaught TypeError: this.fotoramaItem.data(...).activeFrame.$stageFrame[0].trigger is not a function
    at $.<computed>.<computed>._checkForVideo (fotorama-add-video-events.js:605:79)
    at $.<computed>.<computed>._checkForVideo (widget.js:132:25)
    at $.<computed>.<computed>._startPrepareForPlayer (fotorama-add-video-events.js:567:18)
    at $.<computed>.<computed>._startPrepareForPlayer (widget.js:132:25)
    at $.<computed>.<computed>.<anonymous> (fotorama-add-video-events.js:545:22)
    at HTMLDivElement.proxy (jquery.js:10780:23)
    at HTMLDivElement.dispatch (jquery.js:5430:49)
    at elemData.handle (jquery.js:5234:47)
    at Object.trigger (jquery.js:8719:28)
    at HTMLDivElement.<anonymous> (jquery.js:8797:30)

Additional information

image

the issue is caused by changes in the commit e7a06d3#diff-5d428affd814bd350e233104b8fc3b769544ee7e6d04a9b21a8537473876ffadR605

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Nov 10, 2022

Hi @glevhen. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-assistant
Copy link

m2-assistant bot commented Nov 11, 2022

Hi @engcom-Dash. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

@engcom-Dash
Copy link

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@engcom-Dash
Copy link

Hi @glevhen ,

we are trying to reproduce the issue in 2.4-develop branch...But we are not able to reproduce the issue.
we got some different in console.

Steps we followed:
1.install magento instance
2.select any products
3.open the product page which has video in product gallery
4.click on the product image to open the gallery fullscreen mode
5.click on the product video thumbnail

We got js error in console.we are not able to reproduce the issue.

Screenshots:
Screenshot 2022-11-11 at 2 32 33 PM

Let us know if we missing anything!!!

Thanks!!!

@engcom-Dash engcom-Dash added the Issue: needs update Additional information is require, waiting for response label Nov 13, 2022
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Nov 13, 2022
@glevhen
Copy link
Author

glevhen commented Nov 14, 2022

@engcom-Dash did you upload the correct screenshot? from I see the attached screenshot is for admin product settings and not for product page gallery on the storefront, and there is no opened product video on your screenshot
Please, make sure you tested the product gallery on the storefront and followed steps to reproduce

@engcom-Dash
Copy link

engcom-Dash commented Nov 17, 2022

Hi @glevhen ,

Thanks For your Information....Last time I uploaded wrong screenshot Apologise for that.
Again we worked this issue in 2.4-develop branch...The issue is reproducible. So,We are confirming the issue.
the js error will appear in the browser console and video will not autoplay as well as screenshots is attached for your reference.

Preconditions:
Magento version : 2.4-develop
PHP :8.1

Steps we followed:

1.Install fresh 2.4-develop
2.Add product in Magento admin
3.Add Images and videos with respective product
4.Go to front end
5.click the Particular Product
6.Open product image page
7.Click the product image with full screen
8.Click video and check the console
9.The js error is appearing in console as per actual result and video is not autoplay.

Screenshots for your reference:

Screenshot 2022-11-17 at 3 50 06 PM

We are reproduced issue in 2.4-develop instance.So we are confirming the issue.

Let us know if we missing anything!!!

Thanks

@engcom-Dash engcom-Dash added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Reported on 2.4.x Indicates original Magento version for the Issue report. labels Nov 17, 2022
@github-jira-sync-bot
Copy link

Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*

Once all required labels are present, please add Issue: Confirmed label again.

@github-jira-sync-bot github-jira-sync-bot removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Nov 17, 2022
@m2-community-project m2-community-project bot moved this from Needs Update to Confirmed in Issue Confirmation and Triage Board Nov 17, 2022
@m2-community-project m2-community-project bot removed the Issue: needs update Additional information is require, waiting for response label Nov 17, 2022
@m2-community-project m2-community-project bot moved this from Confirmed to Needs Update in Issue Confirmation and Triage Board Nov 17, 2022
@m2-community-project m2-community-project bot added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: needs update Additional information is require, waiting for response labels Nov 17, 2022
@engcom-Dash engcom-Dash removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: needs update Additional information is require, waiting for response labels Nov 17, 2022
@m2-community-project m2-community-project bot moved this from Needs Update to Ready for Confirmation in Issue Confirmation and Triage Board Nov 17, 2022
@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in High Priority Backlog Dec 7, 2022
@m2-community-project m2-community-project bot moved this from Dev In Progress to Pull Request In Progress in High Priority Backlog Dec 7, 2022
@m2-community-project m2-community-project bot added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. labels Mar 29, 2023
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Dev In Progress in High Priority Backlog Apr 10, 2023
@github-jira-sync-bot github-jira-sync-bot added Progress: PR Created Indicates that Pull Request has been created to fix issue and removed Progress: dev in progress labels Apr 12, 2023
@m2-community-project m2-community-project bot moved this from Dev In Progress to Done in High Priority Backlog May 9, 2023
@m2-community-project m2-community-project bot added Progress: done and removed Progress: PR Created Indicates that Pull Request has been created to fix issue Progress: PR in progress labels May 9, 2023
@engcom-Bravo
Copy link
Contributor

Hello,

As I can see this issue got fixed in the scope of the internal Jira ticket AC-7092 by the internal team
Related commits: https://github.com/search?q=repo%3Amagento%2Fmagento2+AC-7092&type=commits

Based on the Jira ticket, the target version is 2.4.7-beta1.

Thanks

@drinkingsouls
Copy link

drinkingsouls commented May 23, 2023

What was the fix for this?
I am having this issue on Magento 2.4.6
When in mobile resolution and gallery screen is fullsize the video does not play and the console is populated with an error.

fotorama-error

@drinkingsouls
Copy link

Was there any solution to this?

@YoeriW
Copy link

YoeriW commented Oct 12, 2023

Was there any solution to this?

@drinkingsouls
Copy this file: vendor/magento/module-product-video/view/frontend/web/js/fotorama-add-video-events.js
Place the file here: app/design/frontend/[VENDOR]/[THEME]/Magento_ProductVideo/web/js/fotorama-add-video-events.js

Change this on line 560 to line 562:

if (this.isFullscreen && this.fotoramaItem.data('fotorama').activeFrame.i === number) { this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].trigger('click'); }

To this:

if (this.isFullscreen && this.fotoramaItem.data('fotorama').activeFrame.i === number) { this.fotoramaItem.data('fotorama').activeFrame.$stageFrame.trigger('click'); }

Now the Product Video will start playing when you click on the thumbnail + the error will not be shown anymore.

If you want the videos to autoplay without being in fullscreen mode, you could change the code to:

if (this.fotoramaItem.data('fotorama').activeFrame.i === number) { this.fotoramaItem.data('fotorama').activeFrame.$stageFrame.trigger('click'); }

You will also need to change on line 703:
this.fotoramaItem.data('fotorama').activeFrame[0].$stageFrame.trigger('click');

To this:
this.fotoramaItem.data('fotorama').activeFrame.$stageFrame.trigger('click');


To remove the console errors I recommend editing this too:
https://github.com/magento/magento2/pull/35017/commits

Copy this file: vendor/magento/magento2-base/lib/web/fotorama/fotorama.js
Place the file here: app/design/frontend/[VENDOR]/[THEME]/web/fotorama/fotorama.js

Your addEvent function should look like this:

Change this (Line 1141):
function addEvent(el, e, fn, bool) { if (!e) return; el.addEventListener ? el.addEventListener(e, fn, !!bool) : el.attachEvent('on' + e, fn); }

To this:

function addEvent(el, e, fn, bool) { if (!e) return; const options = { get passive() { return e === 'wheel'; } } el.addEventListener ? el.addEventListener(e, fn, options) : el.attachEvent('on' + e, fn); }

And on line 522:
addEvent(document, 'touchstart', onOtherStart, true);
to
addEvent(document, 'touchstart', onOtherStart);

This is tested and working on:

  • Google Chrome (Version 118.0.5993.70
  • Mozilla Firefox (Version 118.0.2)
  • Brave Browser (Version 1.59.117 Chromium: 118.0.5993.70)

The autoplay function is not working on:

  • Safari (Version 16.6 (18615.3.12.11.2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Admin UI Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.4-p2 Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
8 participants