Televisions and video

Since SDK 0.2.1

A world shows a video in two ways:

A clip included in the worldA video from the internet
HowUnity's Video Player component with a Video Clip of your projectAn FL# script with a VideoPlayer (video players)
What it playsThe clip, which goes into the world's filesAn address: a video file, a stream, the page of a video site
TogetherEach player's game plays it from its own startYour script keeps everyone at the same moment
Asked to the playerNothingThe first video of a site, except on the big video sites

A Video Player that reads a URL is removed from the world: videos from the internet go through FL# (what a world may hold).

A screen everyone watches

The Television of the example world is a complete screen: a player types an address (or a YouTube link) and presses Play / Pause, and everyone sees the same video at the same moment, players who arrive later included.

To put it in your world:

  1. Import the Example World sample (install the SDK) and copy Flux/Television.cs into your FL# scripts folder, then add it to Flux Sharp Sources of your NW World Config.
  2. Make the screen: an object whose material shows the picture (with URP's Lit, its texture property is _BaseMap).
  3. Put an Audio Source at the screen, for the sound: 3D (Spatial Blend at 1) so it comes from the screen.
  4. Make a World Space canvas next to it with an Input Field, a Button and a Text (UI).
  5. On an object, Add Component, NodeWorld, FL# Script, pick NodeWorldExample.Television, give it a Network Id, and set its fields:
Field
screenThe screen's material.
texturePropertyThe texture property the picture goes into (_BaseMap).
speakerThe Audio Source.
addressThe Input Field: Enter plays the address for everyone.
playPauseThe Button.
statusThe Text: loading, playing, paused, or why it cannot play.
resyncThresholdSeconds a player's video may drift before it jumps back to the shared time (1.5).

The player who acts takes the television's ownership and sends the address, playing or paused, and where the video stands at a time of the server's clock; each game plays the video itself and follows that time.

What the players see

  • The first video of a site asks each player for permission, in a window: Always, This time or Deny (sites a world contacts). The big video sites (YouTube, Twitch, Vimeo…) play without asking, unless the player changed that list. Meanwhile the video is loading.
  • The game turns the page of a video site into its video. A private video, one blocked in the player's region, or one that needs to sign in, does not play (VideoError.AccessDenied).
  • The video player ships with the game on Windows, Linux and Quest. In Play mode, every address plays without a window.