This repository was archived by the owner on Dec 7, 2021. It is now read-only.
forked from fandor/react-native-google-cast
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGoogleCast.js
More file actions
43 lines (41 loc) · 1.24 KB
/
GoogleCast.js
File metadata and controls
43 lines (41 loc) · 1.24 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} from 'react-native';
const {GoogleCast} = NativeModules;
export default {
startScan: function (googleCastReceiverID:string) {
GoogleCast.startScan(googleCastReceiverID);
},
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, customData:object = {}) {
GoogleCast.castMedia(mediaUrl, title, imageUrl, seconds, customData);
},
seekCast: function (seconds:number) {
GoogleCast.seekCast(seconds);
},
togglePauseCast: function () {
GoogleCast.togglePauseCast();
},
getStreamPosition: function (){
return GoogleCast.getStreamPosition();
},
sendTextMessage: function (message:string) {
GoogleCast.sendTextMessage(message);
},
DEVICE_CHANGED: GoogleCast.DEVICE_CHANGED,
DEVICE_AVAILABLE: GoogleCast.DEVICE_AVAILABLE,
DEVICE_CONNECTED: GoogleCast.DEVICE_CONNECTED,
MEDIA_LOADED: GoogleCast.MEDIA_LOADED,
};