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

feat(FEC-10699): add Linear media type recognition by OTT BE response #136

Merged
merged 8 commits into from
Jan 26, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/k-provider/ott/provider-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ const MediaTypeCombinations: {[mediaType: string]: Object} = {
[KalturaAsset.Type.MEDIA]: {
[KalturaPlaybackContext.Type.TRAILER]: () => ({type: MediaEntry.Type.VOD}),
[KalturaPlaybackContext.Type.PLAYBACK]: mediaAssetData => {
if (parseInt(mediaAssetData.externalIds) > 0 || mediaAssetData.objectType === LIVE_ASST_OBJECT_TYPE) {
if (parseInt(mediaAssetData.externalIds) > 0) {
return {type: MediaEntry.Type.LIVE, dvrStatus: 0};
} else if (mediaAssetData.objectType === LIVE_ASST_OBJECT_TYPE) {
return {type: MediaEntry.Type.LIVE, dvrStatus: mediaAssetData.enableTrickPlay ? 1 : 0};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the condition in the ticket discuss enableTrickPlay and mediaAssetData.objectType === LIVE_ASST_OBJECT_TYPE but not mediaAssetData.externalIds

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. pushed a fix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can, OTT doesn't have at all provider parser spec. I think we should add. Just a matter of time :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please discuss with @yairans to add unit tests coverage for this

Copy link
Contributor

@dan-ziv dan-ziv Jan 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RoyBregman suggest to add enum for this (can't remember why we didn't do it so far).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DvrStatus.ON
DvrStatus.OFF

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RoyBregman but need also to assign the enum 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, i thought only declare it ;)
I pushed the wrong file... pushed it now

}
return {type: MediaEntry.Type.VOD};
}
Expand Down