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(ads): Add setVpaidMode to the ima externs #3135

Merged
merged 1 commit into from
Feb 3, 2021
Merged

feat(ads): Add setVpaidMode to the ima externs #3135

merged 1 commit into from
Feb 3, 2021

Conversation

lyjimmy
Copy link
Contributor

@lyjimmy lyjimmy commented Feb 2, 2021

Sets the type of the google.ima.settings object extern to
google.ima.ImaSdkSettings to avoid duplicating the defined methods.
Also adds the setVpaidMode method and VpaidMode enum to the
google.ima.ImaSdkSettings class extern.

Resolves #3134

Copy link
Contributor

@ismena ismena left a comment

Choose a reason for hiding this comment

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

Looks good, let me run the buildbot, and please get back to me on the direct call to the setLocale() method.

google.ima.settings = {};

/** @param {string} locale */
google.ima.settings.setLocale = function(locale) {};
Copy link
Contributor

Choose a reason for hiding this comment

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

You deleted this bit because of duplication with line#180/183, is that correct?
Could you please manually verify that calling google.ima.settings.setLocale() still works/compiles correctly without it. If it does, I'm ok with deleting this.

Copy link
Contributor Author

@lyjimmy lyjimmy Feb 2, 2021

Choose a reason for hiding this comment

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

Yes I changed the type of the google.ima.settings object so that it 'inherits' all of the ImaSdkSettings methods. That way they only need to be defined once in the ImaSdkSettings class. I was able to compile the code* and call google.ima.settings.setLocale('fr') in the local Shaka Player demo app with these changes. Let me know if there's anything else that would be helpful for me to check.

*A note about compiling: I ran into the same issue that the build bot ran into where there was a missing trailing comma. It looks like that problem was introduced with 0845843. I have a local change that adds the comma, but didn't include it with this PR since it's an unrelated change

@shaka-bot
Copy link
Collaborator

Test Failure:

Generating Closure dependencies...
Linting JavaScript...

/var/lib/jenkins/workspace/Manual PR Test (local-tests)/test/text/ssa_text_parser_unit.js
393:63  error  Missing trailing comma  comma-dangle

✖ 1 problem (1 error, 0 warnings)
1 error and 0 warnings potentially fixable with the `--fix` option.

END-BUILD: FAILURE
Build step 'Execute shell' marked build as failure

@ismena
Copy link
Contributor

ismena commented Feb 2, 2021

Yup, the trailing comma thing is not your fault, we're addressing it.
To be on the safe side, could you run build/all.py --fix on your branch and make sure no other issues come up once the comma problem disappears?
The PR looks good to me, and I'll merge it if no other issues are uncovered.

@lyjimmy
Copy link
Contributor Author

lyjimmy commented Feb 2, 2021

There was another seemingly unrelated error that I also had made a local change for to get the build to work, but this was the last one:

shaka-player/test/hls/hls_parser_unit.js:995:17: ERROR - [JSC_ILLEGAL_PROPERTY_CREATION] Cannot add a property to a struct instance after it is constructed. (If you already declared the property, make sure to give it a type.)
  995|           stream.hdr = 'PQ';
                        ^^^

I think this comes from 7137286.

If I add:

/** @type {string} */
this.hdr = '';

to the shaka.text.ManifestGenerator.Stream class constructor then I'm able to build successfully with python build/all.py --fix.

Sets the type of the google.ima.settings object extern to
`google.ima.ImaSdkSettings` to avoid duplicating the defined methods.
Also adds the setVpaidMode method and VpaidMode enum to the
google.ima.ImaSdkSettings class extern.
@lyjimmy
Copy link
Contributor Author

lyjimmy commented Feb 3, 2021

I pulled 2371bd8 into my branch and rebased this change on top. Now python build/all.py succeeds without the --fix flag.

@ismena
Copy link
Contributor

ismena commented Feb 3, 2021

Great. Looks like we have the build fixed. let me run the bot one more time.

@shaka-bot
Copy link
Collaborator

All tests passed!

@ismena
Copy link
Contributor

ismena commented Feb 3, 2021

There we go. Merging. Thanks for the PR and for putting up with our build :)

@ismena ismena merged commit 2567b65 into shaka-project:master Feb 3, 2021
@lyjimmy
Copy link
Contributor Author

lyjimmy commented Feb 3, 2021

Thanks for the help!

joeyparrish pushed a commit that referenced this pull request Feb 9, 2021
Sets the type of the google.ima.settings object extern to
`google.ima.ImaSdkSettings` to avoid duplicating the defined methods.
Also adds the setVpaidMode method and VpaidMode enum to the
google.ima.ImaSdkSettings class extern.
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add setVpaidMode to the ima.js externs file
3 participants