Line data Source code
1 : import 'dart:io';
2 :
3 : import 'package:flutter_chrome_cast/_session_manager/android_cast_session_manager.dart';
4 : import 'package:flutter_chrome_cast/_session_manager/ios_cast_session_manager.dart';
5 :
6 : import 'cast_session_manager_platform.dart';
7 :
8 : /// Main entry point for Google Cast session management functionality.
9 : ///
10 : /// This class provides a platform-agnostic interface for managing Cast sessions,
11 : /// including starting, ending, and monitoring session state. It automatically
12 : /// selects the appropriate platform-specific implementation based on the current OS.
13 : class GoogleCastSessionManager {
14 0 : static final GoogleCastSessionManagerPlatformInterface _instance =
15 0 : Platform.isAndroid
16 0 : ? GoogleCastSessionManagerAndroidMethodChannel()
17 0 : : GoogleCastSessionManagerIOSMethodChannel();
18 :
19 : /// Gets the singleton instance of the session manager.
20 : ///
21 : /// Returns the appropriate platform-specific implementation
22 : /// (Android or iOS) based on the current platform.
23 0 : static GoogleCastSessionManagerPlatformInterface get instance => _instance;
24 :
25 0 : GoogleCastSessionManager._();
26 : }
|