Sie sind nicht angemeldet.

1

Dienstag, 9. Februar 2021, 12:24

KRPANO chroma key masking not working with Javascript

Hello I im having problem with the chroma key property of the videohotspot. when i im tring to apply chroma key for a video hotspots from the javascript like this

Quellcode

1
krpano.call('set(hotspot[hs_name].chromakey, 0x238E54|0.294|0.133);');

which is applying chroma key value on the hotspot properties.
But it is not apply the effect on the video.

But When i create static hotspot in my tour.xml like this:

Quellcode

1
<hotspot  name="speaker" url.html5="plugins/videoplayer.js" url.flash="plugins/videoplayer.swf" videourl="video/video.mp4" distorted="true" capture="false" ath="-293" atv="2" chromakey="0x238E54|0.294|0.133" scale="0.09" loop="true"/>

Inside the scene then it is working perfectly.

but what is the problem when binding chroma key with the javascript is not affecting the video.
what is wrong with this code.

Quellcode

1
krpano.call('set(hotspot[hs_name].chromakey, 0x238E54|0.294|0.133);');

[/code]

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

2

Dienstag, 9. Februar 2021, 12:29

Have you tried using set instead of call?


Quellcode

1
krpano.set('hotspot[hs_name].chromakey','0x238E54|0.294|0.133');



Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

3

Dienstag, 9. Februar 2021, 12:55

One problem:

Zitat

name="speaker"
and

Zitat

hotspot[hs_name]
don't match!

In this case it should be:

Quellcode

1
hotspot[speaker]

4

Mittwoch, 10. Februar 2021, 10:49

Have you tried using set instead of call?


Quellcode

1
krpano.set('hotspot[hs_name].chromakey','0x238E54|0.294|0.133');



Piotr


Thanks you so much for your quick response, I have tried above code but still it is not working on the video i have also change the renderer => webgl but still chromakey not working

Quellcode

1
2
this.krpano.call('set(hotspot[' + hs_name + '].renderer, webgl);');
this.krpano.set('hotspot['+hs_name+'].chromakey','0x238E54|0.294|0.133');




When i log the hotspot data using

Quellcode

1
console.log(this.krpano.get('hotspot['+hs_name+']'));


then the chroma key value showing like this on console


Do you think there could be another possible workaround?
Thanks

Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von »guidosim« (10. Februar 2021, 17:56)


5

Mittwoch, 10. Februar 2021, 10:58

Thank you much for your quick response klaus, i know hotspot name must be same but in my case i'm creating video hotspots dynamically from javascript.

unfortunately it is not working.

Am I missing anything?

Thanks a lot Klaus for finding the time to answer to my query

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »guidosim« (10. Februar 2021, 17:57)


cuongdevjs

Anfänger

Beiträge: 13

Wohnort: Viet Nam

Beruf: JavaScript Engineer

  • Nachricht senden

6

Freitag, 18. Februar 2022, 08:27

remove renderer = css3 if you have it

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »cuongdevjs« (18. Februar 2022, 08:38)