added optional request headers for remote assests (android & ios)
This commit is contained in:
11
Video.js
11
Video.js
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user