-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
54 lines (37 loc) · 1.19 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
'use strict';
var ReactNative = require('react-native');
var TVCast = ReactNative.NativeModules.TVCast;
var resolveAssetSource = require("react-native/Libraries/Image/resolveAssetSource");
var eventEmitter = new ReactNative.NativeEventEmitter(TVCast);
var nextKey = 0;
function isRelativePath(path) {
return !/^(\/|http(s?)|asset|file)/.test(path);
}
TVCast.resetDiscovery = function() {
// calculates the volumes for left and right channels
TVCast.execute("resetDiscovery",JSON.stringify([]),(e)=>{
},(e) => {
// console.log("CHECK ERROR : ",e);
});
}
TVCast.stopCast = function() {
TVCast.stopCasting();
// this.onPlaySubscription = eventEmitter.addListener(
// 'onPlayChange',
// (param) => {
// const { isPlaying, playerKey } = param;
// if (playerKey === this._key) {
// if (isPlaying) {
// this._playing = true;
// }
// else {
// this._playing = false;
// }
// }
// },
// );
}
TVCast.setDevice = function(deviceId,obj,func){
TVCast.setSelectedDevice(deviceId, obj,func);
}
module.exports = TVCast;