Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Video
    • Overview
    • Control
      • Overview
        • Getting started
          • Environment
          • PictureInPictureController
          • VideoSurface
          • YaPlayer
    • Browser autoplay policy
  • Access management
  • Pricing policy
  • Audit Trails events
  • Release notes
  • Troubleshooting

In this article:

  • Contents
  • Description
  • Updating a configuration
  • Network headers
  • Properties
  • Initializers
  • Methods
  • Examples
  1. Video Player
  2. SDK
  3. iOS
  4. CloudVideoPlayer
  5. Environment

Environment

Written by
Yandex Cloud
Updated at November 5, 2026
View in Markdown
  • Contents
  • Description
  • Updating a configuration
  • Network headers
  • Properties
  • Initializers
  • Methods
  • Examples
public struct Environment

An SDK environment is an entry point for creating players and managing the global configuration.

ContentsContents

This page displays:

  • Properties
  • Initializers
  • Methods

DescriptionDescription

Create a single Environment instance when running the application. Use it to get YaPlayer instances.

Updating a configurationUpdating a configuration

You can update a configuration at any time without recreating the environment.

Network headersNetwork headers

Add global headers for all network request of the player.

PropertiesProperties

Name

Type

Description

from

From

Application ID from the current configuration.

InitializersInitializers

@available(*, deprecated, renamed: "init(configuration:)", message: "Use API with Configuration instead")
public init(from: From)

Creates an SDK environment.

Parameters:

  • from: App ID.

public init(configuration: Configuration)

Creates an SDK environment with a specified configuration.

Parameters:

  • configuration: SDK configuration with the application ID and an optional user information provider.

MethodsMethods

public mutating func update(configuration: Configuration)

Updates the SDK configuration without recreating the environment.

Parameters:

  • configuration: New configuration.

public func setGlobalNetworkHeaders(_ headers: [String: String])

Sets HTTP headers added to all network requests of the player.

Parameters:

  • headers: Header dictionary in [name: value] format.

public func setNetworkHeaders(for endpoint: ContentIdEndpoint, headers: [String: String])

Sets HTTP headers for specific content requests.


public static func set(telemetryEndpoint: QuasiEndpoint?)

Overrides the endpoint for sending telemetry.

Parameters:

  • telemetryEndpoint: Custom endpoint or nil to restore the default value.

public static func set(perfEndpoint: QuasiEndpoint?)

Overrides the endpoint for sending performance data (perf events).

Parameters:

  • perfEndpoint: Custom endpoint or nil to restore the default value.

public func player() -> YaPlayer

Creates a new player instance.

The return value is a new YaPlayer instance.

ExamplesExamples

let configuration = Configuration(from: From(raw: "my-ios-app"))
var environment = Environment(configuration: configuration)

// ViewController.swift
let player = environment.player()
let newConfig = Configuration(from: From(raw: "my-ios-app"), clientInfoProvider: provider)
environment.update(configuration: newConfig)
environment.setGlobalNetworkHeaders(["Authorization": "Bearer \(token)"])

Was the article helpful?

Previous
Getting started
Next
PictureInPictureController
© 2026 Direct Cursus Technology L.L.C.