From 200ea564caa73dcf0e802e9d647dc86a291e874b Mon Sep 17 00:00:00 2001 From: Rob Kochman Date: Thu, 10 Jun 2021 16:28:13 +0000 Subject: [PATCH 1/6] Add contributing file and license headers --- .github/workflows/ci.yaml | 14 ++++++++++++++ CONTRIBUTING.md | 29 +++++++++++++++++++++++++++++ src/js/sw/cache.js | 16 ++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 242ce95..143555c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,3 +1,17 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + name: CI/CD Pipeline on: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f7eddc5 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,29 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement (CLA). You (or your employer) retain the copyright to your +contribution; this simply gives us permission to use and redistribute your +contributions as part of the project. Head over to + to see your current agreements on file or +to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code Reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google/conduct/) diff --git a/src/js/sw/cache.js b/src/js/sw/cache.js index 7c2fcff..e0b58dc 100644 --- a/src/js/sw/cache.js +++ b/src/js/sw/cache.js @@ -1,3 +1,19 @@ +/* +Copyright 2021 Google LLC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + export default [ '/', '/api.json', From 70f542aabbaf19b60a7725278233a1ae9dfc20bf Mon Sep 17 00:00:00 2001 From: Rob Kochman Date: Fri, 11 Jun 2021 22:38:14 +0000 Subject: [PATCH 2/6] Changed text to make clear that Safari now supports VP9 --- src/api/streaming/05-efficient-formats.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/streaming/05-efficient-formats.md b/src/api/streaming/05-efficient-formats.md index deca6d1..b4dcfaf 100644 --- a/src/api/streaming/05-efficient-formats.md +++ b/src/api/streaming/05-efficient-formats.md @@ -41,7 +41,7 @@ Consider a video on demand platform like YouTube. The main bottleneck for YouTube is... you, or rather the **available bandwidth** between YouTube servers and your device. YouTube rescales your video and aims to stay under certain bitrate thresholds for every resolution. It also uses `VP9` as an -efficient coding format of choice along with standard `H.264`. +efficient coding format of choice along with `H.264`. This helps YouTube to deliver **smaller video chunks** to clients that support the more efficient coding formats. @@ -57,9 +57,9 @@ options: YouTube chose the free `VP9` codec to **progressively enhance** the experience in clients that implement it. The 4k resolution videos were only -available in`VP9`. Safari does not support the `VP9` codec, which had led to -Safari users being unable to play 4k videos on YouTube but still able to play -1080p. +available in`VP9`. Safari previously did not support the `VP9` codec, which +led to Safari users being unable to play 4k videos on YouTube but still able +to play 1080p. Another options would be to encode your media in several efficient coding formats. Safari supports `H.265`, which means that encoding for `VP9` *and* From 0e55705457a312535c4b12c2620401a8d8ac9acc Mon Sep 17 00:00:00 2001 From: Derek Herman Date: Fri, 16 Jul 2021 16:32:13 -0700 Subject: [PATCH 3/6] Fix missing space --- src/api/streaming/05-efficient-formats.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/streaming/05-efficient-formats.md b/src/api/streaming/05-efficient-formats.md index b4dcfaf..4b7ccc0 100644 --- a/src/api/streaming/05-efficient-formats.md +++ b/src/api/streaming/05-efficient-formats.md @@ -57,7 +57,7 @@ options: YouTube chose the free `VP9` codec to **progressively enhance** the experience in clients that implement it. The 4k resolution videos were only -available in`VP9`. Safari previously did not support the `VP9` codec, which +available in `VP9`. Safari previously did not support the `VP9` codec, which led to Safari users being unable to play 4k videos on YouTube but still able to play 1080p. From 05094df0b9e1dded091d9cb994bbb670151033f8 Mon Sep 17 00:00:00 2001 From: Derek Herman Date: Fri, 16 Jul 2021 16:39:51 -0700 Subject: [PATCH 4/6] Add license header to dynamically generated file --- src/js/utils/generateAssetsToCache.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/js/utils/generateAssetsToCache.js b/src/js/utils/generateAssetsToCache.js index 2059f2c..b121b17 100644 --- a/src/js/utils/generateAssetsToCache.js +++ b/src/js/utils/generateAssetsToCache.js @@ -67,7 +67,23 @@ export default async function generateAssetsToCache(api) { } }); - const data = `export default [\n '${assetsToCache.join("',\n '")}',\n];\n`; + const data = `/* +Copyright 2021 Google LLC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +export default [\n '${assetsToCache.join("',\n '")}',\n];\n`; fs.writeFile('src/js/sw/cache.js', data, () => { const time = Date.now() - start; From 54eda4b0d5694b9f616ed2fcfe9edf9f13e78ccc Mon Sep 17 00:00:00 2001 From: Derek Herman Date: Fri, 16 Jul 2021 16:46:19 -0700 Subject: [PATCH 5/6] Bump version to 1.0.0-beta2 --- package-lock.json | 2 +- package.json | 2 +- src/js/constants.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0b09619..e59db0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "kino", - "version": "1.0.0-beta", + "version": "1.0.0-beta2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b13bb8e..5bb51e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kino", - "version": "1.0.0-beta", + "version": "1.0.0-beta2", "description": "A sample video PWA built for web.dev/media", "main": "src/index.js", "author": "Google", diff --git a/src/js/constants.js b/src/js/constants.js index b040f9d..999a280 100644 --- a/src/js/constants.js +++ b/src/js/constants.js @@ -23,7 +23,7 @@ * There may be adjacent caches used for other purposes and we * want to let the SW know which caches it should purge on upgrade. */ -export const SW_CACHE_NAME = 'static-assets-v1.0.0-beta'; +export const SW_CACHE_NAME = 'static-assets-v1.0.0-beta2'; export const SW_CACHE_FORMAT = /^static-assets-v[a-z0-9.-]+$/; /** From cab851b15bbeaec683ae1991af716a66384b3715 Mon Sep 17 00:00:00 2001 From: Derek Herman Date: Fri, 16 Jul 2021 16:46:58 -0700 Subject: [PATCH 6/6] Update description --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5bb51e0..dbd8c11 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "kino", "version": "1.0.0-beta2", - "description": "A sample video PWA built for web.dev/media", + "description": "A sample offline streaming video PWA built for web.dev/media", "main": "src/index.js", "author": "Google", "license": "Apache-2.0",