How to use Blockly to open url at CoSpaces Apps

How to use Blockly to open url at CoSpaces Apps

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

How to do this? Thanks.

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.

The link doesn’t work.

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

BTW, does it work with mobile apps?

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?

2 Likes

In fact that there should be using VR boswer.

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

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.