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

Preserve seek time and other parameters to amp-youtube from YouTube embeds #6423

Merged
merged 43 commits into from
Sep 9, 2021
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2b00609
Transfer seek time to AMP youtube component from youtube url
dhaval-parekh Jun 24, 2021
d5f56f7
Add php unit test cases
dhaval-parekh Jun 24, 2021
080ded2
Convert youtube iframe into amp-youtube
dhaval-parekh Jun 29, 2021
a4e3290
Add additional data params for amp-youtube components
dhaval-parekh Jun 29, 2021
2e47705
Add unit test case for youtube embeds
dhaval-parekh Jun 29, 2021
55fff1f
Fix the issues from unit test cases
dhaval-parekh Jun 29, 2021
e5fba98
Fix the issues from unit test cases
dhaval-parekh Jun 29, 2021
92ab4be
Use type casting instead of intval()
dhaval-parekh Jun 30, 2021
e9ad832
Add inline comments, remove unwanted code
dhaval-parekh Jun 30, 2021
a5d73e0
Update data-param for amp-youtube
dhaval-parekh Jun 30, 2021
eceb487
Update XPath query to fetch youtube iframe
dhaval-parekh Jul 1, 2021
8804f83
Fix php unit test cases
dhaval-parekh Jul 1, 2021
220af89
Apply suggestions from PR
dhaval-parekh Jul 7, 2021
cae32c0
Update amp youtibe embed handler
dhaval-parekh Jul 7, 2021
12a722c
update unit test cases
dhaval-parekh Jul 7, 2021
520be01
Update and fix unit test cases
dhaval-parekh Jul 7, 2021
8e484f0
Remove redundant code
dhaval-parekh Jul 7, 2021
6808668
Add support of live channel when added as raw iframe
dhaval-parekh Jul 8, 2021
f60fd46
Fix unit test cases
dhaval-parekh Jul 8, 2021
c35ecd9
Add unit test cases for live streaming channel
dhaval-parekh Jul 8, 2021
547f237
Update prepare_attribute()
dhaval-parekh Jul 9, 2021
32e9b2d
Update regex for to find seek time from URL
dhaval-parekh Jul 9, 2021
2d1785a
Add additional unit test cases for video seek time
dhaval-parekh Jul 9, 2021
3ecad1e
Sanitize attribute name
dhaval-parekh Sep 9, 2021
74dfcb8
update unit test cases
dhaval-parekh Sep 9, 2021
7f21703
Revert phpstan ignores
westonruter Sep 9, 2021
2c3ed4d
Try adding phpstan version to composer cache key
westonruter Sep 9, 2021
d519220
Revert "Revert phpstan ignores"
westonruter Sep 9, 2021
0524ae5
Print phpstan version when running on GHA
westonruter Sep 9, 2021
b9827d7
Try removing phpstan before composer install
westonruter Sep 9, 2021
fa6ee15
Fix yml syntax error
westonruter Sep 9, 2021
f93b9a1
Try downloading a specific version of phpstan instead of latest
westonruter Sep 9, 2021
9d51ef4
Try installing phpstan via shivammathur/setup-php
westonruter Sep 9, 2021
9d8e977
Fix issues identified by phpstan
westonruter Sep 9, 2021
8200f3f
Give more explicit array phpdoc type
westonruter Sep 9, 2021
edbcc6f
Remove unreachable code
westonruter Sep 9, 2021
32f358a
Opt to pass-through iframe for unrecognized YouTube URL rather than c…
westonruter Sep 9, 2021
1907df3
Remove condition which cannot be reached since video ID is always pro…
westonruter Sep 9, 2021
aac0e40
Use coversDefaultClass
westonruter Sep 9, 2021
d983fa4
Prevent generating closing IMG tags
westonruter Sep 9, 2021
9eefef9
Let placeholder link point to YouTube permalink and not iframe src
westonruter Sep 9, 2021
46bc356
Fix adding start to placeholder link; improve coverage
westonruter Sep 9, 2021
da36d2d
Make placeholder dependency on video ID more explicit
westonruter Sep 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/php/test-class-amp-youtube-embed-handler.php
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
/**
* Tests for AMP_YouTube_Embed_Handler.
*
* @covers AMP_YouTube_Embed_Handler
* @coversDefaultClass \AMP_YouTube_Embed_Handler
*/
class Test_AMP_YouTube_Embed_Handler extends TestCase {

@@ -35,7 +35,7 @@ class Test_AMP_YouTube_Embed_Handler extends TestCase {
/**
* An instance of this embed handler.
*
* @var AMP_YouTube_Embed_Handler.
* @var AMP_YouTube_Embed_Handler
*/
public $handler;

@@ -138,7 +138,7 @@ public function sanitize_raw_embeds_data_provider() {
/**
* @dataProvider sanitize_raw_embeds_data_provider
*
* @covers AMP_YouTube_Embed_Handler::sanitize_raw_embeds
* @covers ::sanitize_raw_embeds
*/
public function test_sanitize_raw_embeds( $source, $expected ) {

@@ -159,7 +159,7 @@ public function test_sanitize_raw_embeds( $source, $expected ) {
/**
* Test video_override().
*
* @covers AMP_YouTube_Embed_Handler::video_override()
* @covers ::video_override()
*/
public function test_video_override() {
remove_all_filters( 'wp_video_shortcode_override' );
@@ -378,7 +378,7 @@ public function get_video_id_data() {
* Tests get_video_id_from_url.
*
* @dataProvider get_video_id_data
* @covers AMP_YouTube_Embed_Handler::get_video_id_from_url()
* @covers ::get_video_id_from_url()
*
* @param string $url The URL to test.
* @param string|false $expected The expected result.
@@ -422,7 +422,7 @@ public function get_start_time_data() {
* Tests get_start_time_from_url.
*
* @dataProvider get_start_time_data
* @covers AMP_YouTube_Embed_Handler::get_start_time_from_url
* @covers ::get_start_time_from_url
*
* @param string $url The URL to test.
* @param string|false $expected The expected result.