Add amp-izlesene extension to embed videos from izlesene.com#6126
Add amp-izlesene extension to embed videos from izlesene.com#6126aghassemi merged 1 commit intoampproject:masterfrom nokta:master
Conversation
|
/to @aghassemi |
|
@merty Thanks for the PR. I will get back to you with the code review soon, meanwhile, I have a question for you: Does the izlesene's iframe embed have a postMessage API that would allow to send commands such as pause, play, mute, unmute and receive events such as played, paused? We are requesting all new video players to implement our video-interface which would require such functionality. |
examples/izlesene.amp.html
Outdated
| <h2>Izlesene</h2> | ||
|
|
||
|
|
||
| <amp-izlesene |
There was a problem hiding this comment.
Remove this one, just keep the layout responsive example.
| | [`amp-dailymotion`](amp-dailymotion/amp-dailymotion.md) | Displays a [Dailymotion](https://www.dailymotion.com) video. | | ||
| | [`amp-gfycat`](amp-gfycat/amp-gfycat.md) | Displays a [Gfycat](https://gfycat.com) video GIF. | | ||
| | [`amp-jwplayer`](amp-jwplayer/amp-jwplayer.md) | Displays a cloud-hosted [JW Player](https://www.jwplayer.com/). | | ||
| | [`amp-izlesene`](amp-izlesene/amp-izlesene.md) | Displays a Izlesene video. | |
There was a problem hiding this comment.
move to before jwplayer for correct alphabetical sorting.
| @@ -0,0 +1,64 @@ | |||
| /** | |||
| * Copyright 2015 The AMP HTML Authors. All Rights Reserved. | |||
| */ | ||
|
|
||
| import {getDataParamsFromAttributes} from '../../../src/dom'; | ||
| import {addParamsToUrl} from '../../../src/url'; |
|
|
||
| /** @override */ | ||
| preconnectCallback(onLayout) { | ||
| this.preconnect.url('https://www.izlesene.com', onLayout); |
There was a problem hiding this comment.
also preload the exact Url the will become the iframe source. (see comment below about creating a getVideoIframeSrc_ so you can do this.preconnect.preload(this.getVideoIframeSrc_());)
| # limitations under the license. | ||
| # | ||
|
|
||
| tags: { # amp-izlesene |
There was a problem hiding this comment.
Validation looks good, just need to update the two spec_url locations. Thanks!
| @@ -0,0 +1,73 @@ | |||
| <!--- | |||
| Copyright 2015 The AMP HTML Authors. All Rights Reserved. | |||
| </tr> | ||
| <tr> | ||
| <td width="40%"><strong>Examples</strong></td> | ||
| <td><a href="https://ampbyexample.com/components/amp-izlesene/">Annotated code example for amp-izlesene</a></td> |
There was a problem hiding this comment.
This example does not exist, please remove for you and add back after you have submitted a PR to https://github.com/ampproject/amp-by-example to add an example.
|
|
||
| - `data-param-showcontrols=1` becomes `&showcontrols=1` | ||
|
|
||
| Because of limitations in mobile browsers, the `autoplay` param is currently not supported. Follow [this issue](https://github.com/ampproject/amphtml/issues/3799) for updates on autoplay support in AMP. |
There was a problem hiding this comment.
This is no longer true and AMP manages autoplay if your player can implement the "video-interface". Depending on the outcome of that discussion, we need to update this paragraph.
gulpfile.js
Outdated
| declareExtension('amp-image-lightbox', '0.1', true); | ||
| declareExtension('amp-instagram', '0.1', false); | ||
| declareExtension('amp-install-serviceworker', '0.1', false); | ||
| declareExtension('amp-izlesene', '0.1', false, 'NO_TYPE_CHECK'); |
There was a problem hiding this comment.
remove NO_TYPE_CHECK and run gulp check-types to check types and fix issues accordingly.
| error_message: "contents" | ||
| } | ||
| } | ||
| spec_url: "https://www.ampproject.org/docs/reference/extended/amp-izlesene.html" |
There was a problem hiding this comment.
Since this isn't on ampproject.org yet, lets point the spec_url to where the markup that's in this PR will be:
https://github.com/ampproject/amphtml/blob/master/extensions/amp-izlesene/amp-izlesene.md
| value_regex: "[0-9]+" | ||
| } | ||
| attr_lists: "extended-amp-global" | ||
| spec_url: "https://www.ampproject.org/docs/reference/extended/amp-izlesene.html" |
There was a problem hiding this comment.
Also here:
Since this isn't on ampproject.org yet, lets point the spec_url to where the markup that's in this PR will be:
https://github.com/ampproject/amphtml/blob/master/extensions/amp-izlesene/amp-izlesene.md
There was a problem hiding this comment.
Refering the Markdown document instead led to an "Expected/Saw" error so reverted this change to refer to the HTML document.
There was a problem hiding this comment.
Can you include what that error was? It shouldn't happen and should be able to link to the markdown in the PR. If you're still having issues better to remove the spec_url entirely as we don't want URLs in error messages to 404 and we put spec_urls in error messages.
| html_format: AMP4ADS | ||
| tag_name: "SCRIPT" | ||
| spec_name: "amp-izlesene extension .js script" | ||
| mandatory_parent: "HEAD" |
There was a problem hiding this comment.
after mandatory_parent: "HEAD", please add: unique: true. This prevents multiple inclusions of the same script file.
| if (opt_responsive) { | ||
| izlesene.setAttribute('layout', 'responsive'); | ||
| } | ||
| iframe.doc.body.appendChild(izlesene); |
There was a problem hiding this comment.
replace these three lines with
return iframe.addElement(izlesene);
|
@merty when you are ready, please make the requested changes and let us know when done to review again. Thanks! |
|
@merty Just a friendly ping to make the requested changes before this PR can be merged. Thanks! |
|
@gberkman Please let me know when this is ready for review again. Thanks! |
|
@aghassemi It should now be ready for review. Could you please help us fix the following two issues? |
|
|
||
| tags: { # amp-izlesene | ||
| html_format: AMP | ||
| html_format: AMP4ADS |
There was a problem hiding this comment.
This is the second error. This extension is not whitelisted for AMP4ADS so it shouldn't be listed for it.
| tag_name: "SCRIPT" | ||
| spec_name: "amp-izlesene extension .js script" | ||
| mandatory_parent: "HEAD" | ||
| unique: true |
There was a problem hiding this comment.
This is the first error. After unique: true add another line with also_requires_tag: amp-izlesene.
There was a problem hiding this comment.
Actually, we're moving this to using satisfies and requires instead of also_requires_tag. So instead of putting also_requires_tag: amp-izlesene please put above under spec_name, satisfies: "amp-izlesene extension .js script" and below in tag_name: "AMP-IZLESENE" replace the also_requires_tag with requires: "amp-izlesene extension .js script". See this PR as an example.
|
Ping @aghassemi. |
| } | ||
| tags: { # <amp-izlesene> | ||
| html_format: AMP | ||
| html_format: AMP4ADS |
There was a problem hiding this comment.
Please remove html_format: AMP4ADS
|
Note there are three issues outstanding with the protoascii. |
| * @override | ||
| */ | ||
| preconnectCallback(opt_onLayout) { | ||
| this.preconnect.preload(this.getVideoIframeSrc_()); |
There was a problem hiding this comment.
preload is too heavy. Please just do this.preconnect.url(this.getVideoIframeSrc_()); to preconnect.
|
Please reference the markdown in this PR. We don't want error messages with
URLs that 404.
…On Mon, Feb 13, 2017 at 11:22 PM, Mert Yazıcıoğlu ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In extensions/amp-izlesene/0.1/validator-amp-izlesene.protoascii
<#6126>:
> + }
+ spec_url: "https://www.ampproject.org/docs/reference/extended/amp-izlesene.html"
+}
+tags: { # <amp-izlesene>
+ html_format: AMP
+ html_format: AMP4ADS
+ tag_name: "AMP-IZLESENE"
+ disallowed_ancestor: "AMP-SIDEBAR"
+ also_requires_tag: "amp-izlesene extension .js script"
+ attrs: {
+ name: "data-videoid"
+ mandatory: true
+ value_regex: "[0-9]+"
+ }
+ attr_lists: "extended-amp-global"
+ spec_url: "https://www.ampproject.org/docs/reference/extended/amp-izlesene.html"
Refering the Markdown document instead led to an "Expected/Saw" error so
reverted this change to refer to the HTML document.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6126>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABR0lZy9q7fOz__dUwrLW512h1dwvIOPks5rcVZGgaJpZM4Kuo_U>
.
|
| spec_name: "amp-izlesene extension .js script" | ||
| satisfies: "amp-izlesene extension .js script" | ||
| mandatory_parent: "HEAD" | ||
| unique: true |
There was a problem hiding this comment.
Add extension_unused_unless_tag_present: "amp-izlesene" after unique: true to address the last travis error.
|
Ah, that's because your .out file references the ampproject.org url. You
can update that with where your markdown will be in master.
https://github.com/nokta/amphtml/blob/ad305fff22ccef80bc0c86a3fae9215639dab522/extensions/amp-izlesene/0.1/test/validator-amp-izlesene.out
…On Tue, Feb 14, 2017 at 10:59 AM, Mert Yazıcıoğlu ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In extensions/amp-izlesene/0.1/validator-amp-izlesene.protoascii
<#6126>:
> + }
+ spec_url: "https://www.ampproject.org/docs/reference/extended/amp-izlesene.html"
+}
+tags: { # <amp-izlesene>
+ html_format: AMP
+ html_format: AMP4ADS
+ tag_name: "AMP-IZLESENE"
+ disallowed_ancestor: "AMP-SIDEBAR"
+ also_requires_tag: "amp-izlesene extension .js script"
+ attrs: {
+ name: "data-videoid"
+ mandatory: true
+ value_regex: "[0-9]+"
+ }
+ attr_lists: "extended-amp-global"
+ spec_url: "https://www.ampproject.org/docs/reference/extended/amp-izlesene.html"
Sure, you can see it here
<https://travis-ci.org/ampproject/amphtml/builds/201019165>.
<https://camo.githubusercontent.com/4741cb0223d83ef960e33627392fd5a2c4464503/687474703a2f2f692e6d6572742e70772f56754b382b>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6126>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABR0lQQLwuaIs9eyG6IM9f6kgzU_smsJks5rcfmRgaJpZM4Kuo_U>
.
|
|
@honeybadgerdontcare Changing both the .out file and the protoascii file to refer to the same URL did the trick, thanks! Build looks good to go now 👍 CC/ @aghassemi |
|
Great! |
|
Looks good @merty! Thanks for contributing. Merged. |
|
Has the validator.js been updated for this component? I ask because I've tried using this component and I receive the following error in the console: |
|
@bpaduch This component is not in prod yet (will be at the end of this week) but it is in the Dev Channel right now. |
|
@bpaduch Validation changes can take 1-2 weeks to get released to prod. |
|
Okay, if it's in the Dev Channel, wouldn't that categorize the component as "experimental" rather than "stable"? |
|
"experimental" normally means there is an experiment flag around the component and it may stay experimental for a while. In this case, there is no experiment. What we should have done is not pushing the documentation until this made it to prod. Or maybe we can introduce a new "Coming Soon" category where we push the documentation early but telling the user it may take couple of weeks before they can use it. "doc being out of sync with code" happens enough times that I think it is totally worth figuring out a solution for it. |
We're the leading Turkish video network with millions of video views every single day. To enable our users embed videos on their AMP pages as well, we've created the amp-izlesene extension.
Contributors: @gberkman @ferrerodbgm