Canvas is not appearing on the second time


#1

Hi,

I have a “video player”, that is generated with Haxe.

In my code I have a

<div id="player"></div>

and after I run lime.embed(“player”…) - a canvas is added inside this div.

When I route away from this url to another, and come back (it’s a SPA written in angular - it means that it is not a full routing) - I press the same “play button” - and lime.embed happens again.
This time, I can not see the canvas and nothing happens with the video.

Any ideas?


#2

Are there any errors in the console? What version are you using?


#3

Hello,

No errors in console.

I see the “Generated by Haxe 3.4.2” line in the code. Do you mean that version?

Thanks


#4

There was an issue with Haxe 3.4.2, that I don’t remember, so we tend to recommend Haxe 3.4.3 or greater. I’m curious what version of OpenFL and Lime you’re running? :slight_smile:


#5

Hi,

we tried all the latest versions (Haxe, openfl, lime) - and it didn’t work. Also - all the white coloors (in the video player) became yellow.


#6

Currently, running lime.embed will use the same scope as other lime.embed calls. This means if you use static variables, it can interact from one run to the next. Similarly, there’s a chance that one instance of OpenFL could negatively affect another, though we’ve tried to design the library to avoid this in most cases.

I don’t think the NPM version has this problem with scope, though, if you use modules instead of a global script.