Skip to content

Commit

Permalink
Merge branch 'main' into update-artwork
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres authored May 13, 2024
2 parents e561ec3 + 6879d52 commit 0403825
Show file tree
Hide file tree
Showing 9 changed files with 726 additions and 398 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/auto-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Workflow based on the main w3c/spec-prod action example:
# https://github.com/w3c/spec-prod/#basic-usage

name: Build, Validate, Deploy and Publish

on:
# Worflow runs on pull requests where it makes sure that the spec can still be
# generated, that markup is valid and that there are no broken links, as
# well as on pushes to the default branch where it also deploys the generated
# spec to the gh-pages branch and publishes the result to /TR.
# The "workflow_dispatch" hook allows admins to also trigger the workflow
# manually from GitHub's UI.
pull_request: {}
push:
branches: [main]
workflow_dispatch:

jobs:
main:
runs-on: ubuntu-20.04
steps:
# See doc at https://github.com/actions/checkout#checkout-v2
- name: Checkout repository
uses: actions/checkout@v2

# See doc at https://github.com/w3c/spec-prod/#spec-prod
# The action only deploys the generated spec to the gh-pages branch when
# the workflow was triggered by a push to the default branch.
- name: Build and validate index.html, push to gh-pages branch if needed
uses: w3c/spec-prod@v2
with:
GH_PAGES_BRANCH: gh-pages
W3C_ECHIDNA_TOKEN: ${{ secrets.ECHIDNA_TOKEN }}
W3C_WG_DECISION_URL: https://github.com/w3c/media-wg/issues/27
W3C_BUILD_OVERRIDE: |
status: WD
21 changes: 21 additions & 0 deletions .github/workflows/tidy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Tidy document
on:
workflow_dispatch: {}
push:
branches:
- gh-pages
paths:
- index.html

jobs:
tidy:
name: Tidy up
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: make
- uses: peter-evans/create-pull-request@v6
with:
title: "Tidied up source"
commit-message: "chore(index.bs): tidy up"
branch: tidy
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Media Session Standard
# Media Session API

https://w3c.github.io/mediasession/

Expand Down
63 changes: 0 additions & 63 deletions deploy.sh

This file was deleted.

Binary file removed deploy_key.enc
Binary file not shown.
15 changes: 12 additions & 3 deletions explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ interface MediaSession : EventTarget {
### The `MediaMetadata` interface
A `MediaMetadata` object can contain media metadata like title, artist, album
and album art. To set the metadata for a `MediaSession`, the page should create
a `MediaMetadata` object and assign it to a `MediaSession` object:
A `MediaMetadata` object can contain media metadata like title, artist, album,
artwork, and video chapter information. To set the metadata for a `MediaSession`,
the page should create a `MediaMetadata` object and assign it to a `MediaSession`
object:
```javascript
navigator.mediaSession.metadata = new MediaMetadata(/* MediaMetadata constructor */);
Expand All @@ -123,13 +124,21 @@ interface MediaMetadata {
attribute DOMString artist;
attribute DOMString album;
attribute FrozenArray<MediaImage> artwork;
[SameObject] readonly attribute FrozenArray<ChapterInformation> chapterInfo;
};

dictionary MediaImage {
required USVString src;
DOMString sizes = "";
DOMString type = "";
};

[Exposed=Window]
interface ChapterInformation {
readonly attribute DOMString title;
readonly attribute double startTime;
[SameObject] readonly attribute FrozenArray<MediaImage> artwork;
};
```
### The `MediaPositionState` dictionary
Expand Down
6 changes: 3 additions & 3 deletions format.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def tokenize(source):
def validate(path, source, tokens):
stack = []

def fail(reason, offset):
def fail(reason, offset, source, path):
lineno = source.count('\n', 0, offset) + 1
print '%s:%s: error: %s' % (path, lineno, reason)
print source.splitlines()[lineno - 1]
print(f'{path}:{lineno}: error: {reason}')
print(source.splitlines()[lineno - 1])
sys.exit(1)

for token, start, end, name in tokens:
Expand Down
Loading

0 comments on commit 0403825

Please sign in to comment.