Are my media too heavy

User avatar
Kash
Posts: 4
Joined: Fri Feb 17, 2017 9:46 am

Are my media too heavy

Postby Kash » Fri Feb 17, 2017 10:21 am

Hello,

I've been trying to play some movie we made, but the only result I get is a black screen with the *.png of the hotspot.

I'm using the last version of the framework. My media has been converted to three different versions, the lightest is 5MB then 20MB and the best version is 400MB.

I know belgian internet connection is not really good, but after a speedtest, I have a download speed of 71,49Mbps, which should be ok, because I can see the video from the example.

You can have a look here http://95.85.50.110/#elche-one&uid=scene-0

The code of my config file is
  1. {
  2.     "story":
  3.     {
  4.       "uid": "elche-360",
  5.        "name": "Elche 360",
  6.        "slug": "elche-360",
  7.        "description": "Welcome in Elche, biggest palm tree forest in Europe",
  8.        "default": "scene-0",
  9.  
  10.         "scenes":
  11.         [
  12.             {
  13.                 "uid": "scene-0",
  14.                 "name": "Elche 1",
  15.                 "slug": "elche-one",
  16.                 "description": "Welcome in ELche",
  17.  
  18.                 "media":
  19.                 {
  20.                     "uid": "media-0",
  21.                     "type": "video",
  22.  
  23.                     "source":
  24.                     {
  25.                         "format": "equi",
  26.                         "levels": [
  27.                           { "url": "media/elche1-720p.mp4" },
  28.                           { "url": "media/elche1-FHD.mp4" },
  29.                           { "url": "media/elche1-4K.mp4" }
  30.                         ]
  31.                     },
  32.                     "options":
  33.                     {
  34.                       "autoplay": true,
  35.                       "loop": true,
  36.                       "volume": 1
  37.                     }
  38.                 },
  39.                 "hotspots":
  40.                 [
  41.                     {
  42.                         "uid": "hotspot-s0-0",
  43.  
  44.                         "transform":
  45.                         {
  46.                             "position":
  47.                             {
  48.                                 "theta": 0,
  49.                                 "phi": -10.5,
  50.                                 "radius": 400
  51.                             },
  52.  
  53.                             "rotation":
  54.                             {
  55.                                 "x": 80
  56.                             }
  57.                         },
  58.  
  59.                         "material":
  60.                         {
  61.                             "image": "media/Circle_white_64.png",
  62.                             "opacity": 1
  63.                         },
  64.  
  65.                         "events":
  66.                         {
  67.                             "onClick": ["action-loadscene-1", "action-camera-0"]
  68.                         }
  69.                     }
  70.                 ]
  71.             },
  72.  
  73.             {
  74.                 "uid": "scene-1",
  75.                 "name": "Elche 2",
  76.                 "slug": "elche-two",
  77.                 "description": "Continue your visit of ELche",
  78.  
  79.                 "media":
  80.                 {
  81.                     "uid": "media-1",
  82.                     "type": "video",
  83.  
  84.                     "source":
  85.                     {
  86.                         "format": "equi",
  87.                         "url": "media/elche3.mp4"
  88.                     }
  89.                 }
  90.             }
  91.         ]
  92.       }
  93. }


Thank you
Visit our website http://www.poolpio.com

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

Re: Are my media too heavy

Postby rroux » Fri Feb 17, 2017 1:13 pm

Hi Kash!

I found the error! It is not about the size of your media.
It is just because the video doesn't play at all!

Why?
You autoPlay option has a bad syntax:
It is autoPlay, not autoplay (capital P)

Hope this helps :)
- Raphaël

User avatar
Kash
Posts: 4
Joined: Fri Feb 17, 2017 9:46 am

Re: Are my media too heavy

Postby Kash » Fri Feb 17, 2017 2:36 pm

\o/ Victory

Thanks rroux

Now I have to understand the action part cause I can not navigate to the next scene
Visit our website http://www.poolpio.com

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

Re: Are my media too heavy

Postby rroux » Fri Feb 17, 2017 2:55 pm

For the navigation from a scene to another, we will publish a plugin to display two buttons next week if everything is ok on our side.
In the meantime you can put any dom element of your choice on top of the ForgeJS container and bind an event handler on click that does the following in javascript:

  1. viewer.story.previousScene();


  1. viewer.story.nextScene();


OR

you can use the SimpleButton plugin that is available in our sample but it is not very fancy for the moment, so I don't recommend to use it if you can avoid.

OR (the best solution)

If you want to navigate with hotspots, you can bin actions to them in the json configuration

  1. "actions":
  2. [
  3.     {
  4.         "uid": "action-loadscene-0",
  5.         "target": "viewer.story",
  6.  
  7.         "method":
  8.         {
  9.             "name": "loadScene",
  10.             "args": ["scene-0"]
  11.         }
  12.     }
  13. ]


This action will load the scene with the "scene-0" uid when it will be called.

Then you declare events on your hotspot like this:

  1. "hotspots":
  2. [
  3.     {
  4.         "uid": "hotspot-to-scene-0",
  5.  
  6.         ...
  7.  
  8.          "events":
  9.         {
  10.             "onClick": ["action-loadscene-0"]
  11.         }
  12.     }
  13. ]
- Raphaël

User avatar
Kash
Posts: 4
Joined: Fri Feb 17, 2017 9:46 am

Re: Are my media too heavy

Postby Kash » Fri Feb 17, 2017 3:29 pm

Yeah, I did manage to make my hotspot working.

What could be interesting for non-dev like me, is a kind a illustration where the syntax of each block is explain. Sometimes, I'm really lost regarding where should I put that block, should I add a comma, a } or a ].

BTW is there a slack channel for Forgejs?
Visit our website http://www.poolpio.com

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

Re: Are my media too heavy

Postby rroux » Fri Feb 17, 2017 10:36 pm

Sometimes, I'm really lost regarding where should I put that block, should I add a comma, a } or a ].


We use the classic json syntax.

Here are a bit of explanation:

  1. "media": {   }


This is an object called media, starts with { and ends with }.

  1. "media":
  2. {  
  3.     "uid": "unique-identifier",
  4.     "type": "video"
  5. }


This is the same object called media with two more properties uid and type that are characters strings.
There's a comma , after "uid": "unique-identifier", just to separate these two properties (uid and type).
There is no comma after "type": "video" because this is the last property of media.

  1. "media":
  2. {  
  3.     "uid": "unique-identifier",
  4.     "type": "video",
  5.     "source":
  6.     {
  7.         "format": "equi",
  8.         "levels":
  9.         [
  10.             { "url": "myVideo-0.mp4" },
  11.             { "url": "myVideo-1.mp4" }
  12.         ]
  13.     }
  14. }


This is the same object called media with one more properties source that is another object.
The source object is a child of the media object, it starts with a { and ends with a }.
The source object has two properties format and levels.
The source properties (format and levels) have a bigger left margin just for readability. These properties are owned by the source object, and the source object is owned by media. Readability of your json config is very important, this is called indentation.
The format property is a string, and the source property is an array.
There's a comma , after "format": "equi", just to separate these two properties (format and levels).
Arrays are sort of list or collection of objects, they starts with a [ and ends with a ].
Inside the levels array, we have a collection of objects that describes the different levels with a single property called url.
There's a comma , after { "url": "myVideo-0.mp4" }, the first item of the array just to separate it from the second item { "url": "myVideo-1.mp4" }.
There is no comma after { "url": "myVideo-1.mp4" } because this is the last item of the levels array.
There is no comma after the end of the array ] because levels is the last property of the source object.
And so on ...

BTW is there a slack channel for Forgejs?


There is no ForgeJS slack channel.
Good idea, I'll propose that to the team!

Have a nice week end!
- Raphaël

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

Re: Are my media too heavy

Postby rroux » Fri Feb 17, 2017 10:45 pm

BTW I'm thinking about your sample.
In the first scene you could play with sounds.
You put some invisible hotspots in the trees that emit birds sounds and you add a global ambiance windy sound to the scene to reproduce the original ambiance.
So you set the original video volume to zero (or re transcode it without sound to optimize the bandwidth).
It could be nice to hear spatialize sounds with headphones in VR :)

Good job!
- Raphaël

User avatar
Kash
Posts: 4
Joined: Fri Feb 17, 2017 9:46 am

Re: Are my media too heavy

Postby Kash » Tue Feb 21, 2017 6:22 pm

Yeah, that's in the pipe. I'll also try to add some paralax tree. But I'm not happy with my footage, cause of the wind it's not stable at all. I'll work on something else.

I looked everywhere but I did not find control for smartphone. I see there is a way to switch to a cardboard view, but is it possible to use the smartphone movement to move the video?

In the example of the kart, how can we switch from one video to an other while the other one keeps playing? I have shoot a music concert from two different angle and I'd like to be able to switch perspective while the whole song keeps playing?

Thanks again.
Visit our website http://www.poolpio.com

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

Re: Are my media too heavy

Postby rroux » Wed Feb 22, 2017 1:38 pm

Yeah, that's in the pipe. I'll also try to add some paralax tree. But I'm not happy with my footage, cause of the wind it's not stable at all. I'll work on something else.


I agree for the wind, but this a cool footage for prototyping your final production, don't worry :)

I looked everywhere but I did not find control for smartphone. I see there is a way to switch to a cardboard view, but is it possible to use the smartphone movement to move the video?


For now you can only move the camera with the touch mode. If you are in WebVR you can move the camera with the gyroscope. We have to add a gyroscope support for the non WebVR mode (when you handle the phone in your hands without headset). We also have to add a pinch support to change the field of view with two fingers in touch mode.

In the example of the kart, how can we switch from one video to an other while the other one keeps playing? I have shoot a music concert from two different angle and I'd like to be able to switch perspective while the whole song keeps playing?


In the kart demo we have a plugin that handle the synchronization of the two videos but this more a prototype than the proper way to do this. We have to add a way to load the scene with an auto synchronization between the videos current time of these two scenes. We will think about a clean way to declare this behavior in the json configuration. We are aware that this is a very important feature for many people and we will work on it asap. In the meantime if you have a developer, you should take a look at the ranking plugin of the kart demo, this plugin handles the loading of another video scene with the video current time synchronization.

Keep up the good work!

Have a nice day :)
- Raphaël

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

Re: Are my media too heavy

Postby rroux » Wed Mar 08, 2017 10:27 am

Hello Kash,

We have a slack channel like you asked for, I sent you an invitation to join the channel!

Did you check the new ForgeJS 0.9.1 release?

Have a nice day!
- Raphaël

Who is online

Users browsing this forum: No registered users and 2 guests