-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
40 lines (38 loc) · 1.08 KB
/
index.js
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
import { NativeModules } from 'react-native';
const { GoogleCast } = NativeModules;
export default {
startScan: function (appId: ?string) {
GoogleCast.startScan(appId);
},
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,
DEVICE_CONNECTED: GoogleCast.DEVICE_CONNECTED,
DEVICE_DISCONNECTED: GoogleCast.DEVICE_DISCONNECTED,
MEDIA_LOADED: GoogleCast.MEDIA_LOADED,
};