Pixel Streaming
Pixel Streaming allows a high-fidelity interactive experience to be streamed directly to users' device, regardless of its graphical capabilities.
Installation
npm install @msquared/pixel-streaming-client<script src="https://cdn.jsdelivr.net/npm/@msquared/pixel-streaming-client@latest/dist/script/index.js"></script>Usage
import {
StreamingClient,
StreamProvider,
StreamTarget
} from '@msquared/pixel-streaming-client';
// Initialize client
const client = new StreamingClient({
auth: {
// See "How to obtain an auth token"
token: 'your-auth-token',
organizationId: 'your-org-id'
},
logger: console
});
// Listen for state changes
client.addEventListener('streamStateUpdated', (event) => {
console.log('Stream state:', event.detail.state);
});
// Fetch stream configuration
const streamConfig = await client.fetchStreamConfig({
projectId: '<your-project-id>',
worldId: '<your-world-id>',
forceProvider: StreamProvider.GeforceNow,
});
// Start an embedded stream
await client.start({
...streamConfig,
provider: StreamProvider.GeforceNow,
target: StreamTarget.Embedded,
container: '#stream-container',
});Obtaining an Auth Token
Granting streaming permissions for your world
React
Aspect Ratio Support
Supported Aspect Ratios
Last updated
Was this helpful?

