Skip to content

Add amp-izlesene extension to embed videos from izlesene.com#6126

Merged
aghassemi merged 1 commit intoampproject:masterfrom
nokta:master
Feb 15, 2017
Merged

Add amp-izlesene extension to embed videos from izlesene.com#6126
aghassemi merged 1 commit intoampproject:masterfrom
nokta:master

Conversation

@merty
Copy link
Copy Markdown
Contributor

@merty merty commented Nov 10, 2016

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

@jridgewell
Copy link
Copy Markdown
Contributor

/to @aghassemi

@aghassemi
Copy link
Copy Markdown
Contributor

@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.

<h2>Izlesene</h2>


<amp-izlesene
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.

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. |
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.

move to before jwplayer for correct alphabetical sorting.

@@ -0,0 +1,64 @@
/**
* Copyright 2015 The AMP HTML Authors. All Rights Reserved.
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.

2016

*/

import {getDataParamsFromAttributes} from '../../../src/dom';
import {addParamsToUrl} from '../../../src/url';
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.

Sort by import path.


/** @override */
preconnectCallback(onLayout) {
this.preconnect.url('https://www.izlesene.com', onLayout);
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.

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
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.

@honeybadgerdontcare for validator review.

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.

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.
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.

2016

</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>
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.

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.
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.

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');
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.

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"
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.

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"
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.

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

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.

Refering the Markdown document instead led to an "Expected/Saw" error so reverted this change to refer to the HTML document.

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.

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.

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.

Sure, you can see it here.

html_format: AMP4ADS
tag_name: "SCRIPT"
spec_name: "amp-izlesene extension .js script"
mandatory_parent: "HEAD"
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.

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);
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.

replace these three lines with
return iframe.addElement(izlesene);

@aghassemi
Copy link
Copy Markdown
Contributor

@merty when you are ready, please make the requested changes and let us know when done to review again. Thanks!

@aghassemi
Copy link
Copy Markdown
Contributor

@merty Just a friendly ping to make the requested changes before this PR can be merged. Thanks!

@aghassemi
Copy link
Copy Markdown
Contributor

@gberkman Please let me know when this is ready for review again. Thanks!

@merty
Copy link
Copy Markdown
Contributor Author

merty commented Feb 13, 2017

@aghassemi It should now be ready for review. Could you please help us fix the following two issues?

Build #17003


tags: { # amp-izlesene
html_format: AMP
html_format: AMP4ADS
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.

This is the second error. This extension is not whitelisted for AMP4ADS so it shouldn't be listed for it.

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.

Removed 👍

tag_name: "SCRIPT"
spec_name: "amp-izlesene extension .js script"
mandatory_parent: "HEAD"
unique: true
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.

This is the first error. After unique: true add another line with also_requires_tag: amp-izlesene.

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.

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.

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.

Still get this one, but now at a later stage:

@honeybadgerdontcare
Copy link
Copy Markdown
Contributor

@merty I marked in the protoascii how to address those two errors and filed an issue to make the errors more clear #7509

@jridgewell
Copy link
Copy Markdown
Contributor

Ping @aghassemi.

}
tags: { # <amp-izlesene>
html_format: AMP
html_format: AMP4ADS
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.

Please remove html_format: AMP4ADS

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 👍

@honeybadgerdontcare
Copy link
Copy Markdown
Contributor

Note there are three issues outstanding with the protoascii.

* @override
*/
preconnectCallback(opt_onLayout) {
this.preconnect.preload(this.getVideoIframeSrc_());
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.

preload is too heavy. Please just do this.preconnect.url(this.getVideoIframeSrc_()); to preconnect.

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 👍

@honeybadgerdontcare
Copy link
Copy Markdown
Contributor

honeybadgerdontcare commented Feb 14, 2017 via email

spec_name: "amp-izlesene extension .js script"
satisfies: "amp-izlesene extension .js script"
mandatory_parent: "HEAD"
unique: true
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.

Add extension_unused_unless_tag_present: "amp-izlesene" after unique: true to address the last travis error.

@honeybadgerdontcare
Copy link
Copy Markdown
Contributor

honeybadgerdontcare commented Feb 14, 2017 via email

@merty
Copy link
Copy Markdown
Contributor Author

merty commented Feb 14, 2017

@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

@honeybadgerdontcare
Copy link
Copy Markdown
Contributor

Great!
@aghassemi validation looks good.

@aghassemi
Copy link
Copy Markdown
Contributor

Looks good @merty! Thanks for contributing. Merged.

@aghassemi aghassemi merged commit f86437a into ampproject:master Feb 15, 2017
@ghost
Copy link
Copy Markdown

ghost commented Feb 21, 2017

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: The tag 'amp-izlesene' is disallowed. I'm discovering that the script isn't on the CDN --https://cdn.ampproject.org/v0/amp-izlesene-0.1.js.

@aghassemi
Copy link
Copy Markdown
Contributor

@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.

@honeybadgerdontcare
Copy link
Copy Markdown
Contributor

@bpaduch Validation changes can take 1-2 weeks to get released to prod.

@ghost
Copy link
Copy Markdown

ghost commented Feb 21, 2017

Okay, if it's in the Dev Channel, wouldn't that categorize the component as "experimental" rather than "stable"?

@aghassemi
Copy link
Copy Markdown
Contributor

"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.

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.

5 participants