react-native-theoplayer
Version:
A THEOplayer video component for react-native.
46 lines (45 loc) • 1.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NativeCachingTaskAdapter = void 0;
var _DefaultEventDispatcher = require("../adapter/event/DefaultEventDispatcher");
var _reactNative = require("react-native");
var _NativeCachingTaskParametersAdapter = require("./NativeCachingTaskParametersAdapter");
const NativeCacheModule = _reactNative.NativeModules.THEORCTCacheModule;
class NativeCachingTaskAdapter extends _DefaultEventDispatcher.DefaultEventDispatcher {
constructor(task) {
super();
this.bytes = task.bytes;
this.cached = {
...task.cached
};
this.duration = task.duration;
this.id = task.id;
this.bytesCached = task.bytesCached;
this.license = {
renew(drmConfiguration) {
NativeCacheModule.renewLicense(task.id, drmConfiguration);
}
};
this.parameters = (0, _NativeCachingTaskParametersAdapter.fromNativeCachingTaskParameters)(task.parameters);
this.percentageCached = task.percentageCached;
this.secondsCached = task.secondsCached;
// TODO!
this.source = {
...task.source
};
this.status = task.status;
}
pause() {
NativeCacheModule.pauseCachingTask(this.id);
}
remove() {
NativeCacheModule.removeCachingTask(this.id);
}
start() {
NativeCacheModule.startCachingTask(this.id);
}
}
exports.NativeCachingTaskAdapter = NativeCachingTaskAdapter;
//# sourceMappingURL=NativeCachingTaskAdapter.js.map