You are not logged in.

1

Tuesday, February 9th 2021, 12:24pm

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

Source code

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:

Source code

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.

Source code

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

[/code]

spacerywirtualne

Professional

Posts: 1,117

Location: Poland, Europe

Occupation: krpano developer : virtual tours : the cms4vr owner

  • Send private message

2

Tuesday, February 9th 2021, 12:29pm

Have you tried using set instead of call?


Source code

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

Tuesday, February 9th 2021, 12:55pm

One problem:

Quoted

name="speaker"
and

Quoted

hotspot[hs_name]
don't match!

In this case it should be:

Source code

1
hotspot[speaker]

4

Wednesday, February 10th 2021, 10:49am

Have you tried using set instead of call?


Source code

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

Source code

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

Source code

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

This post has been edited 4 times, last edit by "guidosim" (Feb 10th 2021, 5:56pm)


5

Wednesday, February 10th 2021, 10:58am

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

This post has been edited 2 times, last edit by "guidosim" (Feb 10th 2021, 5:57pm)


cuongdevjs

Beginner

Posts: 13

Location: Viet Nam

Occupation: JavaScript Engineer

  • Send private message

6

Friday, February 18th 2022, 8:27am

remove renderer = css3 if you have it

This post has been edited 1 times, last edit by "cuongdevjs" (Feb 18th 2022, 8:38am)