Skip to content
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

Merged
merged 6 commits into from
Jul 19, 2017

Conversation

yairans
Copy link
Contributor

@yairans yairans commented Jul 9, 2017

No description provided.

@yairans yairans changed the title Build progressive urls fix(ovp-provider): build progressive urls correctly Jul 9, 2017
};

let parseProgressiveSources = function () {
let progressiveSource = kalturaSources.find(source => ProviderParser._isProgressiveSource(source));
Copy link
Contributor

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);

Copy link
Contributor Author

@yairans yairans Jul 18, 2017

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);
Copy link
Contributor

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);
    }

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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
@yairans yairans merged commit a414f8d into develop Jul 19, 2017
@yairans yairans deleted the build-progressive-urls branch July 19, 2017 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants