hotspot action visible onEnded

nedr
Posts: 15
Joined: Fri Aug 18, 2017 12:30 pm

hotspot action visible onEnded

Postby nedr » Tue Dec 19, 2017 9:52 pm

is it possible to show a hotspot when a video is ended?
I know how to go to a next scene when video is ended, but I want the user to select the next step with a hotspot..

this is the action I tried:

Code: Select all

{"uid": "action-visible-hotspot", "target":"viewer.hotspot","method":{"args": ["hotspot-start-360-intro-img"]},"property": { "name": "visible", "value": true,"operation": "set"}}


and this is the scene:

Code: Select all

{
                "uid": "scene-plat-intro",
                "name": "scene-videoplat-intro",
                "slug": "scene-videoplat-intro",
                "media": {"uid": "video-plat-intro","type": "video",
               "source":{
                        "format": "flat","stream": "html5",                       
                   "levels": [
                     { "url": "media/video_plat/intro/video-good.mp4", "device": { "desktop": true } },
                     { "url": "media/video_plat/intro/video-medium.mp4", "device": { "tablet": true } },
                     { "url": "media/video_plat/intro/video-low.mp4", "device": { "mobile": true } }
                  ]
                    },
                    "options":{"autoPlay": true,"loop": false,"volume": 1},"events": {"onEnded": ["action-visible-hotspot"]}
                },
            "hotspots":[
               {"uid": "hotspot-start-360-intro-img","visible":false, "facingCenter": true,"geometry": {"type": "plane","options": {"width": 100,"height": 100 }},"transform": {"position": {"x": 0,"y": 0,"z": -220}},"material":{"image": "media/hotspot_start.png","opacity": 0.8},"events":{"onClick": ["laadscene-video360-intro"]},"animation":{"enabled": true,"loop": true,"random": false,"autoPlay": true,"tracks": [ "hotspot-intro-track-1"]}}
            ],
            "view":{"type": "flat","options":{"repeatX": false, "repeatY": false}},
            "camera":{"parallax": 0,"roll": { "default" : 0, "min": 0, "max": 0 },"fov": { "default" : 180, "min": 70, "max": 180 }}
            }

User avatar
rroux
ForgeJS Team
Posts: 160
Joined: Wed Oct 26, 2016 12:19 pm

Re: hotspot action visible onEnded

Postby rroux » Tue Feb 06, 2018 2:15 pm

Hello nedr,

it seems that you have the wrong action
You should target the hotspot by its uid.

  1. {
  2.     "uid": "action-visible-hotspot",
  3.     "target":"hotspot-uid",
  4.     "property":
  5.     {
  6.         "name": "visible",
  7.         "value": true,
  8.         "operation": "set"
  9.     }
  10. }


This will just tell the hotspot with the "hotspot-uid" to set its visible property to true :)

Hope this helps
- Raphaël

Who is online

Users browsing this forum: No registered users and 2 guests