Skip to content

Exposing play, pause, mute, unmute actions and making integration tests run on iOS 10#7171

Merged
aghassemi merged 18 commits intoampproject:masterfrom
aghassemi:playactions
Jan 31, 2017
Merged

Exposing play, pause, mute, unmute actions and making integration tests run on iOS 10#7171
aghassemi merged 18 commits intoampproject:masterfrom
aghassemi:playactions

Conversation

@aghassemi
Copy link
Copy Markdown
Contributor

@aghassemi aghassemi commented Jan 24, 2017

This CL:

@aghassemi aghassemi added the WIP label Jan 24, 2017
```

## Element Specific Events
### form
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@bpaduch for review. I changed the layout of this page (now each component gets its own table rather than all in one table) also added actions and their description for amp-video, amp-youtube.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It seems good. I would recommend putting the elements in alphabetical order (just move sidebar before user-notification).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Also, please add ending punctuation to each description (ie., just needs a period if the sentence doesn't already have one).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

return ViewportType.NATURAL_IOS_EMBED;
}

// Enable iOS Embedded mode for iframed tests (e.g. integration tests).
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@dvoytenko When running integration tests in iOS 10, I was getting the Natural instead of Embed iOS viewport. That was causing certain parts of the test (around scrolling and viewability) to get the wrong values. I think this change makes sense, please confirm.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@aghassemi This is a bit tricky and confusing. We emulate standalone in tests as an iframe. This is because the only way we can run a test is in an iframe. Ideally, we need to be able to indicate whether (while always an iframe) we want to test an iframing viewer case vs standalone case (vs even in-a-box) case. I'm not sure how to communicate all that here... If all tests are ok in this way - we can use this mode and then we can delay accommodating other use cases when we run into them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Discussed offline. Tests pass with this.

</table>

### amp-sidebar
<table>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Needs a header row like the others

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@aghassemi aghassemi removed the WIP label Jan 24, 2017
@aghassemi aghassemi requested review from chenshay and mkhatib January 24, 2017 16:48
@aghassemi
Copy link
Copy Markdown
Contributor Author

/to @mkhatib and @chenshay for review
/cc @dvoytenko

</tr>
<tr>
<td width="30%">amp-image-lightbox</td>
<td>(default)</td>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shouldn't this row be specific to the amp-image-lightbox element? Also, should the action be named as open (default) instead of (default)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good catch. done.

Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Minor changes needed.

Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Approve changes for MD file.

Copy link
Copy Markdown
Contributor

@mkhatib mkhatib left a comment

Choose a reason for hiding this comment

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

LGTM - please make sure to test in /pwa/ and /a4a/ manually as mentioned.

installVideoManagerForDoc(this.getAmpDoc());
const ampdoc = this.getAmpDoc();
installVideoManagerForDoc(ampdoc);
videoManagerForDoc(this.win.document).register(this);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason why videoManagerForDoc is using this.win.document instead of ampdoc? Using win.document might break YouTube inside shadow-doc/embedded use cases. You can test these manually by using the /pwa/ and /a4a/ prefixes before any example to see how it works. For example to test the amp-youtube.amp.max.html example this would be the URLs:

http://localhost:8000/pwa/examples/amp-youtube.amp.max.html
http://localhost:8000/a4a/examples/amp-youtube.amp.max.html

The only gotcha for the pwa example you'd probably need to make sure the service worker installed so it doesn't redirect you to the actual example instead of embedding it into shadow-doc

You could also possibly use this.element for any _ForDoc service call.

cc/ @dvoytenko for any mis-info I am spreading 😄

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd just recommend using installVideoManagerForDoc(this.element). And, yes, this should definitely not be win.document. Is something not working? Maybe this is just a incorrect rebase?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done (including other cases in video players)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Still seeing it. Did it get pushed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ugh, made the change on laptop, forgot to push. should be in now

ampdoc.win.addEventListener(


this.win.addEventListener(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is accurate but please test the /pwa/ and /a4a/ cases and make sure it is behaving as expected.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ack. looks fine in both

const ampdoc = this.getAmpDoc();
ampdoc.win.addEventListener(


Copy link
Copy Markdown
Contributor Author

@aghassemi aghassemi Jan 26, 2017

Choose a reason for hiding this comment

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

to self: use iframe messaging helpers

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will have a separate PR for this.

@aghassemi
Copy link
Copy Markdown
Contributor Author

@mkhatib @dvoytenko PTAL. Thanks.

```

## Element Specific Events
### amp-carousel
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@choumx I moved things around here a bit. Please take a quick look to make sure I did not mess up your recent changes to this file.

Copy link
Copy Markdown
Contributor

@dvoytenko dvoytenko left a comment

Choose a reason for hiding this comment

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

LGTM on my side as soon as the changes to viewerManager lookup are done.

Copy link
Copy Markdown
Contributor

@mkhatib mkhatib left a comment

Choose a reason for hiding this comment

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

LGTM

@aghassemi aghassemi merged commit cd884cf into ampproject:master Jan 31, 2017
torch2424 pushed a commit to torch2424/amphtml that referenced this pull request Feb 14, 2017
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants