React Native Google Cast

React Native Google Cast

  • Docs
  • GitHub

›Components

Getting Started

  • Installation
  • Setup
  • Usage
  • Troubleshooting

Guides

  • Custom Channels
  • Customize UI
  • Events
  • Hooks
  • Media Tracks
  • Queueing
  • Volume

Components

  • CastButton
  • ExpandedController

API

  • CastChannel
  • CastContext
  • CastSession
  • DiscoveryManager
  • RemoteMediaClient
  • SessionManager

Types

  • ApplicationMetadata
  • Device
  • MediaInfo
  • MediaLiveSeekableRange
  • MediaLoadRequest
  • MediaMetadata
    • Generic
    • Movie
    • MusicTrack
    • Photo
    • TvShow
    • User
  • MediaQueueContainerMetadata
  • MediaQueueData
  • MediaQueueItem
  • MediaSeekOptions
  • MediaStatus
  • MediaTrack
  • TextTrackStyle
  • UseCastSessionOptions
  • VideoInfo
  • WebImage

Enums

  • ActiveInputState
  • CastState
  • MediaHlsSegmentFormat
  • MediaHlsVideoSegmentFormat
  • MediaPlayerIdleReason
  • MediaPlayerState
  • MediaQueueContainerType
  • MediaQueueType
  • MediaRepeatMode
  • MediaStreamType
  • PlayServicesState
  • StandbyState

ExpandedController

The expanded controller is a full screen view which offers full control of the remote media playback. This view should allow a casting app to manage every manageable aspect of a cast session, with the exception of receiver volume control and session lifecycle (connect/stop casting). It also provides all the status information about the media session (artwork, title, subtitle, and so forth).

Setup

To use the default expanded controller:

Expo

{
  "expo": {
    "plugins": [
      [
        "react-native-google-cast",
        {
          // ...
          "expandedController": true
        }
      ]
    ]
  }
}

iOS

In AppDelegate's application:didFinishLaunchingWithOptions method add

Objective-C
Swift
[GCKCastContext sharedInstance].useDefaultExpandedMediaControls = true;
GCKCastContext.sharedInstance().useDefaultExpandedMediaControls = true

Android

In AndroidManifest.xml add

<activity android:name="com.reactnative.googlecast.RNGCExpandedControllerActivity" />

Usage

Then, to show the expanded controller, call

GoogleCast.showExpandedControls()

The expanded controller will also be shown automatically when the user taps the mini controller.

Customizing expanded controller

Not implemented yet

Last updated on 9/11/2024 by Petr Bela
← CastButtonCastChannel →
  • Customizing expanded controller