Sie sind nicht angemeldet.

1

Samstag, 26. November 2022, 10:34

videoDOM. srcObject = canvas. captureStream(); The videoplayer can't be used on iOS16. Who can help?

I want to play canvas animation in krpano through videoplayer. Other systems can do this, but iOS 16 can't.

Quellcode

1
2
3
var videoDOM = hotspot.videoDOM; 
videoDOM.srcObject = canvas.captureStream();
hotspot.play();

»MANJAY« hat folgende Dateien angehängt:

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »MANJAY« (3. Dezember 2022, 08:01)


2

Samstag, 10. Dezember 2022, 10:43

Hi,

iOS and html5-video is a topic by its own... *rolleyes*

I don't know why captureStream don't work, but there is an easier solution for using a canvas without the need for videos.

Instead of using a video, the canvas can be added 'videoDOM' element to a krpano plugin element.
Then krpano then thinks this is a video-element and updates its texture every time when its currentTime value changes.

These settings would need to be done, they 'fake' a video-element:

Quellcode

1
2
3
4
5
6
7
plugin.videoDOM = canvas;
plugin.videowidth = canvas_width;
plugin.videoheight = canvas_height;
canvas.readyState = 4;
canvas.videoWidth = canvas_width;
canvas.videoHeight = canvas_height;
canvas.currentTime = 1;


and every time the canvas changes or should be redrawn, modify the currentTime somehow:

Quellcode

1
canvas.currentTime++;


Here a whole plugin source example:
https://krpano.com/viewsource.html?examp…awing/canvas.js

and here the example for trying - click the canvas and draw something:
https://krpano.com/krpano.html?xml=examp…wing/canvas.xml

The example xml:
https://krpano.com/viewsource.html?examp…wing/canvas.xml

Best regards,
Klaus

3

Samstag, 10. Dezember 2022, 12:06

Thanks, Klaus.
krpano is so flexible and powerful.

4

Samstag, 10. Dezember 2022, 13:02

tx as well !
thats a neat technique :)

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »indexofrefraction« (12. Dezember 2022, 23:39)


5

Samstag, 10. Dezember 2022, 15:08

Hi Klaus, support transparent background?

6

Dienstag, 13. Dezember 2022, 15:23

Hi,

in version 1.20 transparent backgrounds are not possible in this case, there the internal texture for videos is always a RGB one.

But in version 1.21 RGBA textures are used for videos (mainly for better performance in Firefox), then transparent canvas elements will work automatically here.

Best regards,
Klaus