How to use Blockly to open url at CoSpaces Apps


#1

How to use Blockly to open url at CoSpaces Apps


#2

Don’t think it can be done using Blockly, but it may be possible using JavaScript.


#3

How to do this? Thanks.


#4

Hi,

at the moment it’s not possible in Blockly and when it comes to JavaScript I answered this question here. Let us know when you have any questions.


#5

The link doesn’t work.

It shows “Sorry, you don’t have access to that topic!”

BTW, does it work with mobile apps?


#6

Sorry, this was my answer there:

We’re working on making external content like videos accessible in CoSpaces as well. When it comes to open websites - at the moment you can use the JS open function in the web app similar to this example (copy it into your editor to try it out):

const btn = Scene.createItem('LP_Cube', 0, 0, 0);

btn.onActivate(() => {
    open('https://cospaces.io/edu/', '_blank');
});

But this function isn’t part of the CoSpaces Scripting API and therefore doesn’t work on mobile.

The question is how should a function like this behave on mobile in VR mode? Imagine that you’re in CoSpaces VR mode using a headset. Then you click on an item, the CoSpaces app closes and a new website opens in the browser. Now you need to take off the headset and take out the phone in order to browse the site. Then you’re done with the website, close the browser, open CoSpaces again and put it in your headset to be in your VR scene. Now you open another link…

Can we implement something like this? Sure. But is it a good solution? What do you think?


#7

In fact that there should be using VR boswer.

On the other hand, I want to use this function to link up some compares.


#8

There is no VR browser in CoSpaces Edu at the moment but I’ll forward your request to our team. The only way to do it now is in the web app using the open function in JavaScript.