Skip to content

Play when visible is not working #57

@RostVY

Description

@RostVY

Quote from readme:

Play if canvas is visible

<canvas #canvas="rivCanvas" riv="knight" width="500" height="500">
  <riv-animation name="idle" [name]="canvas.isVisible | async"></riv-animation>
</canvas>

First: I believe, it should be something like

<riv-animation name="idle" [play]="canvas.whenVisible | async"></riv-animation>

Second the playback control over [play] input is not working at all.
I have a component which has play = false; and template:

<canvas [riv]="animation" width="640" height="325">
    <riv-animation [name]="animationName" [play]="play"></riv-animation>
</canvas>

<button (click)="play = !play">Play</button> {{play}}

Clicking button changes the play property, but animation does not start.

Using Angular 16.2.12, ng-rive 0.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions