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

Add video analytics values to variable substitution #10820

Merged
merged 4 commits into from Aug 8, 2017

Conversation

cvializ
Copy link
Contributor

@cvializ cvializ commented Aug 7, 2017

Closes #9902

Copy link
Contributor

@wassgha wassgha left a comment

Choose a reason for hiding this comment

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

LGTM :)

Copy link
Contributor

@aghassemi aghassemi left a comment

Choose a reason for hiding this comment

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

awesome. One small request

* @return {!Promise<!../video-interface.VideoAnalyticsDetailsDef>|!Promise<undefined>}
*/
getVideoAnalyticsDetails(videoElement) {
for (let i = 0; i < this.entries_.length; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you can call getEntryForVideo_ to find the entry ( it also handles the assert for you), but asserts are not silent, they actually break execution. If you want it to be silent, try-catch the call to getEntryForVideo_ call

Copy link
Contributor

Choose a reason for hiding this comment

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

getEntryForVideo_ takes the video instance not the element. Maybe we should add a getEntryForElement_ method :)

return entry;
}
}
dev().assert(false, 'video is not registered to this video manager');
Copy link
Contributor

Choose a reason for hiding this comment

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

this would throw before the return. should be error() instead

Copy link
Contributor

Choose a reason for hiding this comment

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

actually I wouldn't even log anything. caller can decide

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that dev().error() is more appropriate than dev().assert(). Here I was mirroring the behavior of getEntryForVideo_. Should I change it there too?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes plz.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do. The logging has helped me while developing so I'll keep it in with the assert changed to an error

@cvializ cvializ merged commit bdf905f into ampproject:master Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants