Skip to main content
N
12d ago

.riv not loaded (played)(local test)

Hi! First of all thank you for your work.

I have an issue: I have created a small animation to do a test and downloaded the.riv on my computer. (Mac OS 11.7.6)

I have put the .riv file (1kb) in my images folder. Then I copied a code example that I founded on Rive website, in my html file. But when I loaded the page, I could not see anything. (firefox 132.0.2)

<canvas id="canvas" width="1200" height="600"></canvas>

<script src="https://unpkg.com/@rive-app/canvas@2.20.0"></script>

<script>

const r = new rive.Rive({

src: "images/untitled.riv",

canvas: document.getElementById("canvas"),

autoplay: true,

// artboard: "Arboard", // Optional. If not supplied the default is selected

stateMachines: "bumpy",

onLoad: () => {

// Ensure the drawing surface matches the canvas size and device pixel ratio

r.resizeDrawingSurfaceToCanvas();

},

});

</script>

I guess I missed something ;)

Thank you in adavance for your help and keep the doing amazing work!

Nico

3 replies
N
11d ago

I see that stateMachine is bumpy which probably needs to be updated to your state machine name. If that doesn't help, can you share a zip that contains your code and .riv file?

N
10d ago

Hi Lance and thank you for your answer I have changed the state machine name but it is still not working. you can find a .zip here: https://we.tl/t-xYuBDi60Dk

7d ago

Sorry, that download link doesn't seem to be working. Maybe you could use this example as a starting point instead: