added optional request headers for remote assests (android & ios)

This commit is contained in:
Emrah Kaya
2017-10-02 20:11:41 +02:00
parent f73b7a0484
commit 270fdfb657
7 changed files with 119 additions and 19 deletions

View File

@@ -24,6 +24,16 @@ export default class Video extends Component {
this._root.setNativeProps(nativeProps);
}
stringsOnlyObject(obj) {
const strObj = {};
Object.keys(obj).forEach(x => {
strObj[x] = obj[x].toString();
});
return strObj;
}
seek = (time) => {
this.setNativeProps({ seek: time });
};
@@ -190,6 +200,7 @@ export default class Video extends Component {
type: source.type || '',
mainVer: source.mainVer || 0,
patchVer: source.patchVer || 0,
requestHeaders: source.headers ? this.stringsOnlyObject(source.headers) : {}
},
onVideoLoadStart: this._onLoadStart,
onVideoLoad: this._onLoad,