Skip to content

Commit

Permalink
Merge pull request #135 from xwp/develop
Browse files Browse the repository at this point in the history
Release 1.0.0-beta2
  • Loading branch information
derekherman authored Jul 16, 2021
2 parents 8aed526 + e1df369 commit 85ce961
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 9 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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
<https://cla.developers.google.com/> 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/)
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kino",
"version": "1.0.0-beta",
"description": "A sample video PWA built for web.dev/media",
"version": "1.0.0-beta2",
"description": "A sample offline streaming video PWA built for web.dev/media",
"main": "src/index.js",
"author": "Google",
"license": "Apache-2.0",
Expand Down
8 changes: 4 additions & 4 deletions src/api/streaming/05-efficient-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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*
Expand Down
2 changes: 1 addition & 1 deletion src/js/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.-]+$/;

/**
Expand Down
16 changes: 16 additions & 0 deletions src/js/sw/cache.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
18 changes: 17 additions & 1 deletion src/js/utils/generateAssetsToCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 85ce961

Please sign in to comment.