You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two different ways you can show a video in a scene. One is to stream the video from an external source, the other is to pack the video file with the scene and play it from there.
12
+
There are tree different ways you can show a video in a scene:
13
13
14
-
In both cases, you use a `VideoPlayer` component to control the state of the video. You also need to create a `VideoTexture`, which can be used on a [material]({{< ref "/content/creator/sdk7/3d-essentials/materials.md" >}}) and then applied to any [primitive shape]({{< ref "/content/creator/sdk7/3d-essentials/shape-components.md" >}}) like a plane, cube, or even a cone.
14
+
- Upload a video file as part of the scene contents
15
+
- Stream the video from an external source
16
+
- Stream live via Decentraland cast
17
+
18
+
In all cases, you'll need:
19
+
20
+
- An entity with a [primitive shape]({{< ref "/content/creator/sdk7/3d-essentials/shape-components.md" >}}) like a plane, cube, or even a cone.
21
+
- A [material]({{< ref "/content/creator/sdk7/3d-essentials/materials.md" >}}) with a A `VideoTexture` assigned to its texture
22
+
- A `VideoPlayer` component to control the state of the video.
15
23
16
24
{{< hint warning >}}
17
25
**📔 Note**: Keep in mind that streaming video demands a significant effort from the player's machine. For this reason, we recommend never having more than one video stream displayed at a time per scene. Videos are also not played if the player is standing on a different scene. Also avoid streaming videos that are in very high resolution, don't use anything above _HD_.
18
26
{{< /hint >}}
19
27
20
28
## Show a video
21
29
22
-
The following instructions apply both to streaming and to showing a video from a file:
30
+
The following instructions apply to all three video showing options:
23
31
24
32
1. Create an entity to serve as the video screen. Give this entity a `MeshRenderer` component so that it has a visible shape.
25
33
@@ -69,7 +77,10 @@ VideoPlayer.create(screen, {
69
77
})
70
78
```
71
79
72
-
## About Streaming
80
+
See [Streaming using Decentraland cast](#streaming-using-decentraland-cast) for details on how to use this third alternative method.
81
+
82
+
83
+
## About External Streaming
73
84
74
85
The source of the streaming must be an _https_ URL (_http_ URLs aren't supported), and the source should have [CORS policies (Cross Origin Resource Sharing)](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) that permit externally accessing it. If this is not the case, you might need to set up a server to act as a proxy and expose the stream in a valid way.
75
86
@@ -89,6 +100,36 @@ See [Required permissions]({{< ref "/content/creator/sdk7/projects/scene-metadat
89
100
90
101
To launch your own video streaming server, we recommend using a [Node Media Server](https://github.com/illuspas/Node-Media-Server), which provides most of what you need out of the box. See
91
102
103
+
## Streaming using Decentraland Cast
104
+
105
+
You can livestream from your camera or share your screen using [Decentraland Cast]({{< ref "/creator/worlds/cast.md">}}). This streaming method uses the same comms architecture used for live communications between players, and is easy to set up and has a lot less delay than streaming from external sources.
106
+
107
+
{{< hint warning >}}
108
+
**📔 Note**: Decentraland cast is only available to use in a World, not in scenes published to Genesis City. See [Decentraland Cast]({{< ref "/creator/worlds/cast.md">}}) for more information. As Worlds have a limited capacity of maximum 100 players at a time, this streaming method can only reach that maximum amount.
109
+
{{< /hint >}}
110
+
111
+
112
+
Call `getActiveVideoStreams` to fetch a list of all live streams active in the current World. The example below uses the first stream returned by this method:
Each stream returned by `getActiveVideoStreams` contains the following fields:
127
+
128
+
-`trackSid`: contains a unique track id that allow the player to play the video stream
129
+
-`identity` : the address of the person that is streaming
130
+
-`sourceType`: can be `VideoTrackSourceType.VTST_SCREEN_SHARE` or `VideoTrackSourceType.VTST_CAMERA`
131
+
132
+
92
133
## Video Materials
93
134
94
135
The default properties of a material make the video look rather opaque for a screen, but you can enhance that by altering other properties of the material.
@@ -327,7 +368,7 @@ function mySystem() {
327
368
}
328
369
```
329
370
330
-
<!--
371
+
<!--
331
372
332
373
## Map a video texture
333
374
@@ -341,7 +382,7 @@ use uvs to map parts of the video
341
382
342
383
-->
343
384
344
-
<!--
385
+
<!--
345
386
## Handle a video file
346
387
347
388
When playing a video from a file, you can perform the following actions:
@@ -356,4 +397,3 @@ When playing a video from a file, you can perform the following actions:
Decentraland Cast is a specialized tool tailored for world owners and other authorized individuals. It offers the capability to stream camera footage or share screens seamlessly within their world.
8
+
9
+
## Streaming
10
+
11
+
At the moment, streaming via [Decentraland Cast](https://cast.decentraland.org) is an exclusive feature reserved for world owners and individuals who possess deployment rights. For more details on these rights, refer to the [ACL]({{< ref "/creator/worlds/about.md#access-control-lists-acl" >}}) section.
12
+
13
+
If authorized, users have the option to either activate their cameras or share their screens directly within the app.
14
+
15
+
A notable feature of the Decentraland Cast web application is its flawless integration with the world. This ensures that irrespective of whether you are connected via the world itself or the Cast app, communication remains uninterrupted. Users can effortlessly send, receive, and listen to chat and voice messages.
16
+
17
+
## Other users in the cast app
18
+
19
+
While users can readily join the Decentraland Cast application, those lacking streaming authorization will find their capabilities restricted. Specifically, they will not have permissions to broadcast any data, whether it be video, voice chat, or text messaging.
20
+
21
+
## Scene
22
+
23
+
A scene should be deployed in the world with the ability to handle video streams. To delve deeper into the specifics of this integration, please consult the [Decentraland SDK]({{< ref "/content/creator/sdk7/media/video-playing.md#streaming-using-decentraland-cast" >}}) documentation.
0 commit comments