-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ovp-provider): build progressive urls correctly #15
Conversation
}; | ||
|
||
let parseProgressiveSources = function () { | ||
let progressiveSource = kalturaSources.find(source => ProviderParser._isProgressiveSource(source)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for using find? are you looking only for the first progressive source in the sources response?
Also, you can pass only the filtering function like this:
kalturaSources.find(ProviderParser._isProgressiveSource);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only for the first.
done.
let parseAdaptiveSources = function () { | ||
kalturaSources.forEach((source) => { | ||
if (ProviderParser._isProgressiveSource(source) === false) { | ||
let parsedSource = ProviderParser._parseAdaptiveSource(source, ks, partnerID, uiConfId, entry, playbackContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general the signature of both _parseAdaptiveSource
and _parseProgressiveSources
can be the same:
(source, flavorAssets, ks, partnerId, uiConfId , entry)
and if I'm not mistaken, entry is only used for entryId so you can already pass entry.id always instead of entry.
Of course don't forget flow signature definition update, and in _parseProgressiveSources
need to define it, currently it is not defined at all.
and if we are still in the spirit of functional programming, you can do this instead:
let parseAdaptiveSources = function () {
kalturaSources.filter((source) => !ProviderParser._isProgressiveSource(source)).
forEach(addAdaptiveSource);
};
let addAdaptiveSource = function(source){
let parsedSource = ProviderParser._parseAdaptiveSource(source, ks, partnerID, uiConfId, entry, playbackContext);
let sourceFormat = SUPPORTED_FORMATS.get(source.format);
sources.map(parsedSource, sourceFormat);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mediaSource.mimetype = 'video/mp4'; | ||
mediaSource.height = flavor.height; | ||
mediaSource.width = flavor.width; | ||
mediaSource.bandwidth = flavor.bitrate * 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we need the bandwidth attribute, what is it used for this days?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ui. analytics.
…ders into build-progressive-urls # Conflicts: # dist/ottProvider.js # dist/ottProvider.js.map # dist/ottProvider.min.js # dist/ottProvider.min.js.map # dist/ovpProvider.js # dist/ovpProvider.js.map # dist/ovpProvider.min.js # dist/ovpProvider.min.js.map # dist/statsService.js # dist/statsService.js.map # dist/statsService.min.js # dist/statsService.min.js.map
No description provided.