rdkcentral / Lightning

Lightning - The WPE UI Framework for developing Apps and UX
Apache License 2.0
187 stars 108 forks source link

Unable to run lightning on QT5 browser #491

Open MikePask opened 1 year ago

MikePask commented 1 year ago

I have been trying to compile a version of lightning that will run on QT5. The issue I currently have is ImageData() is not a constructor. ImageData constructor is not available on this browser, QT5 is similar to safari 7. ImageData constructor appears to be available from Safari 8.

erikhaandrikman commented 1 year ago

Are you using the canvas2d renderer? And is this line causing the error? https://github.com/rdkcentral/Lightning/blob/2e4c829be45614290405c222bf102022a6219153/src/renderer/c2d/C2dRenderer.mjs#L98

MikePask commented 1 year ago

Yes I am and that is the line.

erikhaandrikman commented 1 year ago

https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData is available since Safari 8 but we can try to fallback to createImageData() method, that is available since Safari 4: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createImageData

I've added a quick implementation for you to test: https://github.com/rdkcentral/Lightning/compare/feat/c2d-imagedata-fallback if this works we can do a proper implementation