Sansar Docs
  • 🚀Welcome to Sansar
  • 📚GLOSSARY
  • 🎏Patch Notes
  • 😇Work in Progress
  • ⚠️Creative Commons License
  • Support
    • General Troubleshooting
      • General FAQ
      • The Sansar Cache
      • The Sansar Log
    • Contact Support
  • Sansar Basics
    • Installation And Compatibility
      • Installing Sansar
      • System Requirements
      • Sansar Compatibility FAQ
      • Sansar on Mac
      • Body Tracking Vive
      • Configuring Firewalls
    • Account Management
      • Account Set Up
      • Avatar Name and ID
      • Adding Payment Method
      • Discord FAQ
      • Steam Integration
      • Subscription FAQ
    • Controls
      • Avatar Hand Gestures in VR
      • FreeCam and CineCam
      • Game Controller Buttons
      • HTC VIVE controls
      • Keyboard Shortcuts for Editing a Scene
      • Keyboard Shortcuts for Styling Your Avatar
      • Keyboard Shortcuts for Visiting an Experience
      • Mouselook Mode
      • Oculus Rift Controls
      • Vive Index Controls
    • Settings
      • General Settings
    • VR Settings
      • VR Settings Menu
      • Calibrating Height in VR
  • Exploring in Sansar
    • Navigate and Explore
      • The Codex
      • Instances
      • Interactive objects
      • The Main Menu
      • The Nexus
      • Portals
      • Quests
      • Quick Start: Exploring in Sansar
    • Socialize And Connect
      • Chat Panel
      • Experience Points, Levels, and Titles.
      • Finding People in Sansar
      • Identifying Interacting With Avatars
      • The People panel
      • User profiles
    • Attending events
      • Deploying Unpublished Event to Event World
      • Adding Events to Your Calendar
      • Attending Events in Sansar
      • Avatar Broadcasting FAQ
      • Creating Your Own Events
      • Redemption Codes
      • Tipping
    • Share Content
      • Streaming Sansar
      • Taking a photo
  • Avatar Creation
    • Avatar Basics
      • Avatar 2.0 FAQ
      • Customizing Your Avatar
      • Avatar Emotes
      • The Avatar Editor
    • Dressing The Avatar
      • Fitting Designer Clothing to your Avatar
      • Setting Custom Emotes
      • Wearing Accessories
      • Wearing Rigged Clothing
    • Managing Avatar Items
      • Importing Avatar-Related Items
      • Editing an inventory item's name
      • Editing an inventory item's image
      • Deleting avatar looks from your inventory
      • Importing a custom emote animation
      • Managing your avatar looks inventory items
    • Avatar Resources
      • Avatar Reference Files
      • Blender - Avatar files
      • Blender - Using Decimate Tool
      • Exporting Custom Avatars From Blender
      • Sansar Skeleton Skinning Details
      • Using Animation Skeleton
  • Creating In Sansar
    • Importing Things to Sansar
      • Supported file types
      • AABB Bounding Box and Item Restrictions
      • Importing Audio
      • Importing a Custom Avatar
      • Importing World Items
      • Importing Collision Volumes
      • Importing Accessories
      • Importing Clothing
      • Importing Emotes
      • Importing Hair
      • Importing Custom Scripts
      • Importing a Skybox
      • Troubleshooting Import Errors
    • Shaders and Materials
      • Shaders Information
      • Materials Information
      • VAT Shader Guides
        • VAT Shader Basics
        • VAT Technical Info
      • Displacement Guides
        • Simple Displacement
        • Advanced Displacement
    • Marvelous Designer Info
      • Marvelous Designer Integration
      • Marvelous Designer Creator Resources
      • Marvelous Import and Export
      • MD Limitations
    • Shader Scripting
    • Materials editing and shaders
    • Creator Tools
      • Creating a World
      • Creating Quests
      • Diagnostics Toolbar
      • Importing Items to Sansar
      • My Worlds Panel
    • Managing Worlds
      • Quick start: Creating experiences in Sansar
      • Deleting an experience or scene
      • Deploying a new scene to an existing experience
      • Editing a scene
      • Experience memos
      • Linking A Scene To A World
      • Managing your scenes and worlds
      • Moderation Tools for World Owners
      • Publishing Options for Your Experiences
      • Renaming a scene
      • Saving and Building A Scene
      • Sharing Your Experiences
      • Visiting your own experience
    • Part Of The World Editor
      • Object Stats Toolbar
      • Object Components
      • Parenting objects
      • Scene Item Inventory
      • Scene Objects Panel
      • Collision Volumes
      • Scene Settings
      • System objects
      • Object Motion Types
    • Working With Scripts
      • Working With Scripts
      • Working With Trigger Volume
      • Referencing Scene Components
      • Intro to Scripting in Sansar
      • Using the Script Console
      • Setting Script Parameters
      • Adding Scripts to an Object
      • Configuring Teleport Scripts
      • Simple Script User Guide
    • Working With Audio and Video
      • Working With Audio
      • Creating Media surface
      • Streaming Web Audio
      • Audio Emitter
      • Sansar Audio FAQ
      • Using Media Streams
      • Ambisonic Sounds
      • High Quality Spacial Audio
      • Audio Resource - Room Tones
      • Previewing Audio and Video in a Scene
      • Using Audio Materials
    • Working With Lights
      • Working With Lights
      • Light Types
      • Global Illumination
  • Sansar Store
    • Using the Sansar Store
      • The Sansar Store
      • Buying Items From The Store
      • Redelivering Lost Purchases
    • Buying and Selling Sansar Dollars
      • Gifting Sansar Dollars
      • Buying Sansar Dollars
      • Converting Sansar Dollars
      • Processing US Dollar Credit
    • Selling Your Content
      • Hidden Store Listings
      • Selling Items in Sansar Store
      • Selling Items in an Experience
      • Allowing Resale Of Items
      • Buyers Permissions
  • Guidelines and Moderation
    • Guidelines and Policies
      • Terms of service
      • Sansar's Discord Server Rules
      • Community Standards
      • Content Guidelines
      • World Publishing Guidelines
      • Store Listing Guidelines
      • Store Banner Guidelines
      • Event Guidelines
      • Privacy Policy
      • Sansar Freeware License Agreement
      • Intellectual Property Infringement Notification
      • Cookie Policy
    • Moderation and Reporting
      • Abuse and Griefing
      • Blocking Avatars
      • Muting Avatars
      • Reporting abuse
      • Reporting issues and bugs
      • Security issues
  • Script API Docs
    • General Information
      • External Script Repository's
      • Sansar Script API
      • Script API Updates
      • Restricted API's
    • Example Scripts
      • Example Scripts in Sansar
      • Cannonball
      • Follow The Path
      • Random Movement
      • Reflective Detector
      • Simple Script
      • Sound Randomizer
      • Stats Example
      • Teleport Hotkeys
      • Visitor Tracker
      • Mover Examples
    • Sansar Namespace
      • Namespace
      • Color
      • Mathf
      • Quarterion
      • Vector
      • Vector Extensions
    • Sansar.Script Namespace
      • AddEntryAttribute
      • CancelData
      • ComponentID
      • CoroutineException
      • Default Attributes
      • Editor Visible Attribute
      • Entries Attribute
      • Event Data
      • ICoroutine
      • IEvent Subscription
      • Instance Interface
      • Locked Attribute
      • Log
      • MaxEntriesAttribute
      • Memory
      • MinEntriesAttribute
      • NonReflectiveAttribute
      • ObjectID
      • OperationCompleteEvent
      • RangeAttribute
      • Reflective
      • Script.Base
      • Script Event Data
      • Script Handle
      • ScriptID
      • SessionID
      • Simple Script Event Data
      • ThrottleException
      • Timer
      • Tooltip Attribute
    • MetaData Namespace
      • Assembly MetaData
      • Script MetaData
    • Sansar Script Testing Namespace
      • Assertion Failure Exception
      • Assertions
    • Sansar Utility Namespace
      • GenericEnumerable <T>
      • GenericEnumerable<T>.GetItem
      • JSON Serialization Data
      • JSON Serialization Data 1
      • JSON Serializer
      • JSON Serializer Options
    • Sansar Simulation Namespace
      • Agent Info
      • Animation
      • Audio Component
      • Camera Control Mode
      • Character Tracker
      • Chat
      • Client
      • Cluster
      • Command Action and Data
      • Component Type
      • Control Point Type
      • Held Object
      • HTTP
      • Interaction
      • Light
      • Media Action
      • Mesh Component
      • Modal Dialogue
      • Move Mode and Mover
      • Objective
      • PlayHandle
      • PlaySettings
      • PlayStatus
      • Quest
      • RayCastHit
      • Rigid Body
      • Scene
      • Scene Public
      • Simple Script
      • Sit Event Type
      • Sit Object Data
      • Sound Resource
      • Stream Channel
      • Tutorial Hint
      • UI
      • User Data
Powered by GitBook
On this page
  • Media Surfaces
  • Formatting a Twitch URL for media surfaces
  • Audio Streams
  • Previewing your media streams
  1. Creating In Sansar
  2. Working With Audio and Video

Using Media Streams

PreviousSansar Audio FAQNextAmbisonic Sounds

Last updated 6 months ago

Media Surfaces

In order to make use of a , you must set a Media Stream URL.

The Media Surface Settings section of the allows you to set a media URL and set the location and volume of audio playback in the scene for that media URL.


You can adjust the following settings:

  • Media Stream URL - Enter the URL of a web page you would like to play in your scene. Note that the media only plays once and then stops unless otherwise specified by the URL. Read on below for more information on how to properly format a YouTube or a Twitch URL for media surfaces.

  • Source Width - Set the height of the media, in pixels (e.g. 1920 for most 1080p videos).

  • Source Height - Set the width of the media, in pixels (e.g. 1080 for most 1080p videos).

Formatting a YouTube embed URL for media surfaces

YouTube (including live content) is officially supported for video playback. For the best playback experience, you need to format your Media Stream URL using specific flags:

  • http://www.youtube.com/embed/[VIDEO_ID]?autoplay=1&loop=1&controls=0&allowfullscreen=1&playlist=[VIDEO_ID], where [VIDEO_ID] is the unique ID for the video.

Here are step-by-step instructions on how to construct the YouTube URL:

  1. Take note of the video ID, which is the text after the last forward slash in the embed link. For example:

    YouTube Link

    Video ID

    https://www.youtube.com/embed/oa1s4pka2pA

    oa1s4pka2pA

  2. Add (with no space in between): ?autoplay=1&loop=1&controls=0&allowfullscreen=1&playlist= after the embed link.

  3. Then, add the video ID after that string. For example, the media URL for the Sansar trailer (with the video ID "a1s4pka2pA") would be: https://www.youtube.com/embed/oa1s4pka2pA?autoplay=1&loop=1&controls=0&allowfullscreen=1&playlist=oa1s4pka2pA

Formatting a Twitch URL for media surfaces

Twitch is officially supported for video playback in Sansar. For the best experience, format your Media Stream URL as follows:

  • http://player.twitch.tv/?channel=[CHANNEL_ID]&html5&volume=1, where [CHANNEL_ID] is the channel's unique ID.

  • Alternatively, you can use http://twitchtheater.tv/[CHANNEL_ID]/c, where [CHANNEL_ID] is the channel's unique ID and /c hides chat. However, this link format also displays some of the website's user interface elements in the upper-right corner of the media surface.

Audio Streams

To set the audio streams for a scene:

  1. While editing the scene, open the Scene Settings panel by choosing Tools > Scene Settings.

  2. Under Audio Streams in the Scene Settings panel, enter info for up to four streams:

    • Stream URL - Set a URL for streaming audio content.


Previewing your media streams


Known issues (March 20, 2018)

Media surfaces can occasionally fail to play back media. The workaround for this temporary issue is to force the stream to reload, as follows:

  1. Enable Options > Audio/Video preview.

  2. Verify that the media surface isn’t playing and remains white.

  3. Disable Audio/Video preview.

  4. Open Tools > Scene Settings.

  5. Scroll down to Background Sound in the Properties panel.

  6. Set Sound Source to Stream.

  7. Choose an Audio stream (not the Media stream).

  8. Save the scene.

  9. Open My Experiences from the App Launcher and reload the scene by clicking Edit this scene.

  10. Open Tools > Scene Settings.

  11. Scroll down to Background Sound in the Properties panel and set it to the Media stream.

  12. Save the Scene.

  13. Enable Audio/Video preview.

  14. Verify that the media surface is playing as intended.

You may need to repeat these steps multiple times before the media stream plays successfully.


Media Stream Name - Enter a name for the media stream. This is helpful for identifying the stream when setting up for positional audio.

Note: In order to hear audio for a media stream, you must also set up an to play the audio portion of the stream.

Make sure to use the link (only the part in quotes after "src=" in the Embed field).

You may use to play up to four different audio streams in an experience.

Name - Choose a name for the audio stream. This is a useful identifier when setting up to play the stream.

Place an in the scene, set its Sound Source to Stream in the Properties panel, and choose one of the audio streams from the Stream dropdown list.

You can preview your audio and media content by toggling Audio/Video preview in the Options menu while editing a scene. For more information on previewing media and audio in your scene, see .

Have more questions? Ask in our

audio emitters
audio emitter
embed
audio emitters
audio emitters
audio emitter
Previewing audio and video in a scene
Discord!
media surface
Scene Settings panel
Media Surface Settings in the Scene Settings panel.
Web audio streams in the Scene Settings panel.
Use Audio/Video preview to play your scene's media and sounds while editing the scene.