diff --git a/packages/common/src/dotlottie-player.ts b/packages/common/src/dotlottie-player.ts index e832d9f9..e306ea6e 100644 --- a/packages/common/src/dotlottie-player.ts +++ b/packages/common/src/dotlottie-player.ts @@ -1564,7 +1564,7 @@ export class DotLottieCommonPlayer { // If loop = number, and animation has reached the end, call stop to go to frame 0 if (typeof this._loop === 'number') this.stop(); - const lastFrame = this.direction === -1 ? 0 : this.totalFrames; + const lastFrame = this.direction === -1 ? 0 : this.totalFrames - 1; this.goToAndStop(lastFrame, true); diff --git a/packages/player-component/cypress/component/interactivity/enable-interactivity.cy.ts b/packages/player-component/cypress/component/interactivity/enable-interactivity.cy.ts index 35b0fff8..047a52ac 100644 --- a/packages/player-component/cypress/component/interactivity/enable-interactivity.cy.ts +++ b/packages/player-component/cypress/component/interactivity/enable-interactivity.cy.ts @@ -53,7 +53,7 @@ describe('Interactivity: enter/exit interactivity', () => { cy.get('[name="currentState"]').should('have.value', PlayerState.Playing); cy.get('[name="loop"]').should('have.value', 'false'); cy.get('[name="autoplay"]').should('have.value', 'false'); - cy.get('[name="frame"]').should('have.value', 30); + cy.get('[name="frame"]').should('have.value', 29); cy.get('[name="speed"]').should('have.value', 1); // State: playReverse diff --git a/packages/player-component/cypress/component/interactivity/state-toggle.cy.ts b/packages/player-component/cypress/component/interactivity/state-toggle.cy.ts index 4a5dd949..9758e4d7 100644 --- a/packages/player-component/cypress/component/interactivity/state-toggle.cy.ts +++ b/packages/player-component/cypress/component/interactivity/state-toggle.cy.ts @@ -40,7 +40,7 @@ describe('Interactivity: state_toggle (onClick)', () => { cy.get('[name="currentState"]').should('have.value', PlayerState.Playing); cy.get('[name="loop"]').should('have.value', "false"); cy.get('[name="autoplay"]').should('have.value', "false"); - cy.get('[name="frame"]').should('have.value', 30); + cy.get('[name="frame"]').should('have.value', 29); // State: playReverse cy.get('[data-testid="testPlayer"]').shadow().find('.animation').click({force:true}); diff --git a/packages/react-player/cypress/component/interactivity/enable-interactivity.cy.tsx b/packages/react-player/cypress/component/interactivity/enable-interactivity.cy.tsx index 1c5b4fa9..ffe7c2c5 100644 --- a/packages/react-player/cypress/component/interactivity/enable-interactivity.cy.tsx +++ b/packages/react-player/cypress/component/interactivity/enable-interactivity.cy.tsx @@ -78,7 +78,7 @@ describe('Interactivity: enter/exit interactivity', () => { cy.get('[name="currentState"]').should('have.value', PlayerState.Playing); cy.get('[name="loop"]').should('have.value', 'false'); cy.get('[name="autoplay"]').should('have.value', 'false'); - cy.get('[name="frame"]').should('have.value', 30); + cy.get('[name="frame"]').should('have.value', 29); cy.get('[name="speed"]').should('have.value', 1); // State: playReverse diff --git a/packages/react-player/cypress/component/interactivity/state-toggle.cy.tsx b/packages/react-player/cypress/component/interactivity/state-toggle.cy.tsx index 4120847d..4a92eefc 100644 --- a/packages/react-player/cypress/component/interactivity/state-toggle.cy.tsx +++ b/packages/react-player/cypress/component/interactivity/state-toggle.cy.tsx @@ -58,7 +58,7 @@ describe('Interactivity: state_toggle (onClick)', () => { cy.get('[name="currentState"]').should('have.value', PlayerState.Playing); cy.get('[name="loop"]').should('have.value', 'false'); cy.get('[name="autoplay"]').should('have.value', 'false'); - cy.get('[name="frame"]').should('have.value', 30); + cy.get('[name="frame"]').should('have.value', 29); // State: playReverse cy.get('.animation').click({ force: true });