This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
43 lines (40 loc) · 1.2 KB
/
index.js
File metadata and controls
43 lines (40 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { NativeModules, requireNativeComponent } from 'react-native';
const { GoogleCast } = NativeModules;
export default {
startScan: function () {
GoogleCast.startScan();
},
stopScan: function () {
GoogleCast.stopScan();
},
isConnected: function () {
return GoogleCast.isConnected();
},
getDevices: function () {
return GoogleCast.getDevices();
},
connectToDevice: function (deviceId: string) {
GoogleCast.connectToDevice(deviceId);
},
disconnect: function () {
GoogleCast.disconnect();
},
castMedia: function (mediaUrl: string, title: string, imageUrl: string, seconds: number = 0) {
GoogleCast.castMedia(mediaUrl, title, imageUrl, seconds);
},
seekCast: function (seconds: number) {
GoogleCast.seekCast(seconds);
},
togglePauseCast: function () {
GoogleCast.togglePauseCast();
},
getStreamPosition: function () {
return GoogleCast.getStreamPosition();
},
DEVICE_AVAILABLE: GoogleCast.DEVICE_AVAILABLE,
DEVICES_UPDATED: GoogleCast.DEVICES_UPDATED,
DEVICE_CONNECTED: GoogleCast.DEVICE_CONNECTED,
DEVICE_DISCONNECTED: GoogleCast.DEVICE_DISCONNECTED,
MEDIA_LOADED: GoogleCast.MEDIA_LOADED,
};
export const button = requireNativeComponent('GoogleCast', null);