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
Conversation
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.
LGTM :)
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.
awesome. One small request
src/service/video-manager-impl.js
Outdated
* @return {!Promise<!../video-interface.VideoAnalyticsDetailsDef>|!Promise<undefined>} | ||
*/ | ||
getVideoAnalyticsDetails(videoElement) { | ||
for (let i = 0; i < this.entries_.length; i++) { |
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.
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
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.
getEntryForVideo_
takes the video instance not the element. Maybe we should add a getEntryForElement_
method :)
src/service/video-manager-impl.js
Outdated
return entry; | ||
} | ||
} | ||
dev().assert(false, 'video is not registered to this video manager'); |
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.
this would throw before the return. should be error() instead
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.
actually I wouldn't even log anything. caller can decide
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.
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?
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.
yes plz.
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.
Will do. The logging has helped me while developing so I'll keep it in with the assert changed to an error
Closes #9902