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

Extension amp-3q-player added #7999

Merged
merged 30 commits into from May 2, 2017
Merged

Conversation

JuliusThms
Copy link
Contributor

Extension amp-3q-player added for embedding Video from 3qsdn

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@JuliusThms
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

JuliusThms pushed a commit to JuliusThms/amphtml that referenced this pull request Mar 6, 2017
JuliusThms pushed a commit to JuliusThms/amphtml that referenced this pull request Mar 6, 2017
JuliusThms pushed a commit to JuliusThms/amphtml that referenced this pull request Mar 6, 2017
JuliusThms pushed a commit to JuliusThms/amphtml that referenced this pull request Mar 6, 2017
JuliusThms pushed a commit to JuliusThms/amphtml that referenced this pull request Mar 6, 2017
JuliusThms pushed a commit to JuliusThms/amphtml that referenced this pull request Mar 6, 2017
JuliusThms pushed a commit to JuliusThms/amphtml that referenced this pull request Mar 7, 2017
JuliusThms pushed a commit to JuliusThms/amphtml that referenced this pull request Mar 7, 2017
@JuliusThms
Copy link
Contributor Author

JuliusThms commented Mar 7, 2017

Is there someone who can help with the validator? It's not passing the validation at the end.
@honeybadgerdontcare It would be a great pleasure to me to have your support

@honeybadgerdontcare
Copy link
Contributor

@JuliusThms Thanks for contributing!

It looks like there may be some filenaming changes that need to be made and I'll point out some things for validation. The filenames should reflect the name of your component which is 3q-player so for instance in the examples folder it should be 3q-player.amp.html.

The validator issue can be found at the bottom of the travis build:
https://travis-ci.org/ampproject/amphtml/builds/208554798

The issue is that the .out file has no contents. It should have the results of if the .html file passes or fails and if fails what are the errors. So if there were no errors then the .out file should have one line saying PASS.

Failures:
1) ValidatorFeatures amp-3q-player/0.1/test/validator-amp-3q.html
  Message:
    AssertionError: 
    amp-3q-player/0.1/test/validator-amp-3q.out:1:0
    expected:
    
    saw:
    FAIL
    amp-3q-player/0.1/test/validator-amp-3q.html:41:4 The mandatory attribute 'data-id' is missing in tag 'amp-3q-player'. (see https://www.ampproject.org/docs/reference/extended/amp-3q-player.html) [AMP_TAG_PROBLEM]
  Stack:
    AssertionError: 
    amp-3q-player/0.1/test/validator-amp-3q.out:1:0
    expected:
    
    saw:
    FAIL
    amp-3q-player/0.1/test/validator-amp-3q.html:41:4 The mandatory attribute 'data-id' is missing in tag 'amp-3q-player'. (see https://www.ampproject.org/docs/reference/extended/amp-3q-player.html) [AMP_TAG_PROBLEM]
        at ValidatorTestCase.run (/home/travis/build/ampproject/amphtml/validator/dist/validator_test_minified.js:902:398)
        at Object.<anonymous> (/home/travis/build/ampproject/amphtml/validator/dist/validator_test_minified.js:904:248)
2) ValidatorFeatures amp-3q-player/0.1/test/validator-amp-3q.html
  Message:
    AssertionError: 
    amp-3q-player/0.1/test/validator-amp-3q.out:1:0
    expected:
    
    saw:
    FAIL
  Stack:
    AssertionError: 
    amp-3q-player/0.1/test/validator-amp-3q.out:1:0
    expected:
    
    saw:
    FAIL
        at ValidatorTestCase.run (/home/travis/build/ampproject/amphtml/validator/dist/validator-light_test_minified.js:797:486)
        at Object.<anonymous> (/home/travis/build/ampproject/amphtml/validator/dist/validator-light_test_minified.js:798:323)
4201 specs, 2 failures

@@ -0,0 +1,23 @@
<!doctype html>
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename to 3q-player.amp.html.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@@ -0,0 +1,54 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename to test-amp-3q-player.js.

@@ -0,0 +1,54 @@
/**
* Copyright 2016 The AMP HTML Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/2016/2017

@@ -0,0 +1,190 @@
/**
* Copyright 2016 The AMP HTML Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/2016/2017

@@ -0,0 +1,47 @@
<!--
Copyright 2016 The AMP HTML Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/2016/2017

@@ -0,0 +1,71 @@
#
# Copyright 2016 The AMP HTML Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/2016/2017

@@ -0,0 +1,54 @@
<!---
Copyright 2016 The AMP HTML Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/2016/2017

@@ -0,0 +1,47 @@
<!--
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename to validator-amp-3q-player.html.

error_message: "contents"
}
}
spec_url: "https://www.ampproject.org/docs/reference/extended/amp-3q-player.html"
Copy link
Contributor

Choose a reason for hiding this comment

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

ampproject recently changed the urls, while this will redirect to the new one, lets just point to the new location instead, https://www.ampproject.org/docs/reference/components/media/amp-3q-player.

mandatory: true
}
attr_lists: "extended-amp-global"
spec_url: "https://www.ampproject.org/docs/reference/extended/amp-3q-player.html"
Copy link
Contributor

Choose a reason for hiding this comment

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

ampproject recently changed the urls, while this will redirect to the new one, lets just point to the new location instead, https://www.ampproject.org/docs/reference/components/media/amp-3q-player.

satisfies: "amp-3q-player"
requires: "amp-3q-player extension .js script"
attrs: {
name: "data-id"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just an FYI: It is possible to enforce certain values for this in addition to making it mandatory. This can be done with value_regex or value_regex_casei. Up to you if you want to try and implement that type of regex.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ill do the next days.

JuliusThms pushed a commit to JuliusThms/amphtml that referenced this pull request Mar 8, 2017
layout="responsive">
</amp-3q-player>

<!-- invalid, needs data-id -->
Copy link
Contributor

Choose a reason for hiding this comment

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

In addition to the .out file being empty, this is also a reason the travis build is failing. This test file will fail. So the .out file should start with FAIL followed by the errors in the file. According to the travis output we saw earlier it was expecting to see:

FAIL
    amp-3q-player/0.1/test/validator-amp-3q.html:41:4 The mandatory attribute 'data-id' is missing in tag 'amp-3q-player'. (see https://www.ampproject.org/docs/reference/extended/amp-3q-player.html) [AMP_TAG_PROBLEM]

This would go into the .out file. Note that after you update the spec_url, that the above would reflect the spec_url. So if you copy/paste this, please also update the spec_url here.

JuliusThms pushed a commit to JuliusThms/amphtml that referenced this pull request Mar 8, 2017
@honeybadgerdontcare
Copy link
Contributor

Note I made some comments on files that were renamed, so you may want to look at outdated changes to see those comments. Let me know if you have other questions.

@JuliusThms
Copy link
Contributor Author

@honeybadgerdontcare Many Thanks for your review. I commited the changes.

spec_name: "amp-3q-player extension .js script"
satisfies: "amp-3q-player extension .js script"
mandatory_parent: "HEAD"
requires: "amp-3q-player"
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of requires here lets use this instead: extension_unused_unless_tag_present: "amp-3q-player". This also means we get to remove the satisfies: "amp-3d-player" below.

@jridgewell
Copy link
Contributor

Sorry by stuck in loading I meant the inner video player is stuck, the iframe is loaded fine

Yes. But is this a message that is sent by the player and received by AMP (if so, it's our code's problem), or is this one sent by AMP to the player (if so, it's 3q's). From reading your comment, I was under the impression is was this

@JuliusThms
Copy link
Contributor Author

@jridgewell Yes, you we're right. We changed the player so it's getting not fired too early. We have to wait some hours until the change is deployed.

@aghassemi
Copy link
Contributor

@JuliusThms In the ideal situation, player sends the ready message as soon as possible but then it internally queues up commands (like play, mute, etc..) it receives until it is fully ready to execute them. This way user gets to see the player earlier. This is an optimization you can do later in the player without changing amp-3q-player.

@aghassemi
Copy link
Contributor

@JuliusThms Current tests failures are the unit tests and not related to video-interface integration tests. They should be simple to fix and are probably due to the all the new code changes.

@JuliusThms
Copy link
Contributor Author

@aghassemi Ok, i'll take a look

@JuliusThms
Copy link
Contributor Author

JuliusThms commented May 2, 2017

@aghassemi Changed the unit tests, should be running fine now.

@JuliusThms
Copy link
Contributor Author

@aghassemi The tests are passing, are we ready to go?

html_format: AMP
tag_name: "AMP-3Q-PLAYER"
requires: "amp-3q-player extension .js script"
attrs: {
Copy link
Contributor

Choose a reason for hiding this comment

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

add autoplay

  attrs: {
    name: "autoplay"
    value: ""
  }

if (this.unlistenMessage_) {
this.unlistenMessage_();
}
return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

please also add:

    this.playerReadyPromise_ = new Promise(resolve => {
      this.playerReadyResolver_ = resolve;
    });

before returning.

@aghassemi
Copy link
Contributor

@JuliusThms This is looking amazing! Thanks for taking the time to fully implement the video-interface. Two more small requests and then we can finally merge. Sorry for long review process, but this is turning out to be one of the best video players in AMP.

@JuliusThms
Copy link
Contributor Author

JuliusThms commented May 2, 2017

@aghassemi I made the changes. Many thanks for the time you invest. It's a pleasure to contribute to this great project, and thanks for the good feedback!

@aghassemi aghassemi merged commit 25395cb into ampproject:master May 2, 2017
@aghassemi
Copy link
Contributor

Merged!

@aghassemi
Copy link
Contributor

will take about three weeks until code is fully in production (including validator changes)

@JuliusThms
Copy link
Contributor Author

@aghassemi Great! Let me know if i can do something!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants