Getting started¶
This page is the five-step path from a fresh Unity 6 project to a playing video. For installation details, deep platform notes, and the bootstrap explanation, follow the links at the end.
What you need¶
- Unity 6 LTS (
6000.x) — verified on6000.4.6f1. Older Unity LTS (2022 / 2023) may also work (untested), provided they offer.NET Standard 2.1as an Api Compatibility Level option. - A short NTFS project path on Windows — for example,
C:\unity\MyApp. Avoid Dev Drive (ReFS) and very long paths; Unity's package cache can overflow Windows' 260-characterMAX_PATH. - For the mobile / Apple targets, the matching Unity module installed via Unity Hub (Android Build Support, iOS Build Support, macOS Build Support).
Step 1 — Download the cumulative .unitypackage¶
VisioForge.MediaBlocks.Unity.unitypackage
https://files.visioforge.com/unity/VisioForge.MediaBlocks.Unity.unitypackage
The package is self-contained — managed assemblies, every supported native runtime, sample scenes, and the one-time setup helper are all inside it. No NuGet restore, no external GStreamer install, no per-platform downloads.
Step 2 — Import the package¶
In Unity: Assets → Import Package → Custom Package…, select the downloaded .unitypackage, and click Import with all items checked.
The published cumulative package adds all four platform runtimes (a custom private build only includes the platforms its -Include* switches opted into):
Assets/StreamingAssets/VisioForge/x64/— Windows native runtimeAssets/Plugins/Android/— Android native runtimeAssets/Plugins/macOS/— macOS native runtimeAssets/Plugins/iOS/GStreamerX.framework/— iOS native runtimeAssets/Plugins/— managed SDK assembliesAssets/Scripts/— the sharedVisioForgeEnvironment,VisioForgeVideoView, and two sample player componentsAssets/Scenes/SimplePlayer.unityandAssets/Scenes/RTSPViewer.unity— sample scenesAssets/VisioForge/— the one-time setup helper and (on mobile / macOS builds)link.xml
Step 3 — Apply the project settings¶
On first import the setup helper offers to apply the mandatory settings. Click Apply and both are configured for you:
| Setting | Value | Why |
|---|---|---|
| Api Compatibility Level | .NET Standard 2.1 | The SDK ships as netstandard2.1 assemblies. The legacy .NET Framework setting cannot load them. |
| Enter Play Mode → Reload Domain | Disabled | The SDK initializes once per process; a domain reload between Play sessions can hang the Editor while the GLib main loop is mid-call. |
If you click Skip, set both manually under Edit → Project Settings:
- Player → Other Settings → Configuration → Api Compatibility Level
- Editor → Enter Play Mode Settings → When entering Play Mode (any option that does not reload the domain —
Reload Scene onlymatches what Apply does)
For mobile targets (Android, iOS), set Scripting Backend = IL2CPP in the same Configuration section. Mono is not supported on Android or iOS by Unity itself.
Step 4 — Run the sample scene¶
- In the Project window open
Assets/Scenes/SimplePlayer.unity(double-click — do not stay on the empty default scene). - Select the RawImage GameObject in the Hierarchy.
- In the Inspector set File Path to an absolute path to a local media file.
- Press ▶ Play.
Video renders in the Game view; audio plays through the system default device.
If you have a local RTSP camera, open Assets/Scenes/RTSPViewer.unity instead, set Rtsp Url (plus Login / Password if the camera requires authentication), and press Play.
Step 5 — Adapt to your own scene¶
You do not have to use the sample scenes. To play a video into your own UI:
- Add a Canvas → Raw Image (GameObject → UI → Raw Image).
- Select the Raw Image and Add Component →
MediaBlocksPlayer(orRTSPViewerPlayerfor RTSP). - Set the File Path (or Rtsp Url) field and press ▶ Play.
The aspect handling, vertical flip, and Texture2D upload are handled by the bundled VisioForgeVideoView. Your script is just the pipeline — see Play a media file in Unity for the C# breakdown.
Build for a target platform¶
When you are ready to ship:
- Windows x64 — Editor and Standalone Player baseline.
- Android — IL2CPP arm64, AndroidManifest permissions, build size notes.
- macOS — Universal arm64+x86_64, code-signing and notarization.
- iOS — Xcode export, Info.plist permissions, IL2CPP arm64 device only.
The cumulative .unitypackage contains every platform you opted into when it was built; Unity picks the right runtime per Build Target via the per-file PluginImporter metadata.
See also¶
- Install the Media Blocks SDK in Unity — installation reference
- Using VisioForge in Unity — architecture and rendering overview
- Bootstrap and lifecycle — what
Configure()andInitializeSdk()do - Platform matrix — feature availability by platform
- Troubleshooting — common errors and fixes