Skip to content

Commit

Permalink
Initial draft
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelmegitt committed Feb 25, 2021
1 parent 21c1bc4 commit 74f310b
Show file tree
Hide file tree
Showing 33 changed files with 17,190 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"presets": [
"@babel/preset-env",
"@ava/stage-4"
],
"env": {
"development": {
"plugins": [
"istanbul",
"transform-class-properties"
],
"minified": false
},
"production": {
"plugins": [],
"minified": true
}
}
}
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/*
**/*.min.js
**/*.min.es6
rollup.config.js
38 changes: 38 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
"extends": "walmart/configurations/es6-browser",
"plugins": [
"import",
],
"rules": {
"no-empty-label": 0,
"no-labels": 1,

"no-arrow-condition": 0,
"no-confusing-arrow": 2,
"no-constant-condition": 2,

"space-after-keywords": 0,
"space-before-keywords": 0,
"space-return-throw-case": 0,
"keyword-spacing": 2,

"filenames/filenames": 0,

"no-console": 1,
"no-magic-numbers": 0,
"consistent-this": 0,
"prefer-template": 0,
"max-len": ["warn", {code:160}],

"max-params": ["error", 6],

"no-console": "off",

// "max-statements": ["error", 30]

},
"env": {
"browser": true,
"node": true,
}
};
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.lock
*.log
*.swp
.DS_Store
.nyc_output/
node_modules/
bin/
coverage/
dist/
DRAD182Y01-1-audioDescription.fixed.deduped.ttml
DRAD182Y01.mp4
DRAD182Y01.wav
X.babel.config.js
/.idea/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stable
47 changes: 47 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Contributing

Thank you for your interest in Adhere!

## Issues

We welcome bug reports and feature requests for the API implementations and their provisioning. These should be submitted as Issues on GitHub:

- [Sign up][join] for GitHub if you haven't already done so.
- Check whether someone has already submitted a similar Issues.
- If necessary, submit a new Issue.

## Submitting changes

You can submit changes through a GitHub pull request as follows:

* Fork the repository.
* Make and commit changes.
- Please ensure that contact information is available with the commit data.
* Push your changes to a topic branch in your fork.
* Sign the ICLA if you haven't already done so (see below).
* Submit a pull request.

### Contributor Licence Agreement

We desire that contributors of pull requests have signed, and submitted via email, an [Individual Contributor Licence Agreement][ICLA] (ICLA), which is based on the [Apache ICLA][Apache-ICLA].

The purpose of this agreement is to clearly define the terms under which intellectual property has been contributed to the BBC and thereby allow us to defend the project should there be a legal dispute regarding the software at some future time.

If you haven't signed and emailed the agreement yet then the project owners will contact you using the contact info with the pull request.

* We may in the future use a tool that allows you to sign online through your GitHub id and automatically checks this when you submit a pull request.




## Joining the Audio Description Community Group

If you wish to get more involved in creating audio description specifications, working to implement and improve them, then your organisation may benefit from joining the W3C Audio Description Community Group ([ADCG](https://www.w3.org/community/audio-description/)) or the W3C Timed Text Working Group ([TTWG](https://www.w3.org/AudioVideo/TT/)).



[join]: https://github.com/join "GitHub sign-up"

[ICLA]: ICLA.md "ICLA"

[Apache-ICLA]: https://www.apache.org/licenses/icla.pdf "Apache ICLA"
3 changes: 3 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@


THIS SOFTWARE IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NON-INFRINGEMENT IS EXPRESSLY DISCLAIMED. ANY USE OF THIS SOFTWARE SHALL BE MADE ENTIRELY AT THE IMPLEMENTER'S OWN RISK, AND NEITHER BBC, NOR ANY OF ITS CONTRIBUTORS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SOFTWARE.
84 changes: 84 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,86 @@
# adhere-lib
Javascript library for processing AD profile TTML2 and presenting with an HTML video element

adhere-lib is a reference implementation for the TTML2 Spec work it is to showcase
the use of audio attributes that can be controlled from a TTML2 document.

## Prerequisites
- [Node.js](https://nodejs.org/en/)
- [NVM](https://github.com/creationix/nvm)

## Basic build instructions

# Setup

```Shell
nvm install 12.12.0
nvm use 12.12.0
```
`cd` to project dir

```Shell
npm install
```

# Execution

```
npm run-script build # builds the project once.
npm run-script watch # builds the project and watches for changes, rebuilding when needed.
npm run-script start # runs local web server with development resources and opens the page.
```

The build artefacts are placed into the `dist` folder. Either serve `index.html`
from that folder yourself or use the webpack-dev-server to serve it.

When you have the page open in a browser window, then:
* select ttml such as `example.ttml` from the root of this project
* select video such as an mp4 you have lying around
* or serve your own video, TTML and resources referenced from the TTML, and choose by URL
* press play

## Testing

Cucumber tests exist but the scripts to run them no longer exist.

Unit tests can be run using:
```
npm run-script test
```

## Linting

Please make sure that all code is linted before it is committed to the repo
otherwise it will fail the Continuous delivery tests on the GOCD server.
Linting happens as part of the build script.

## Continuous Delivery

Information about the previous builds can be found here
[MPAS Go CD](https://gocd.pas.tools.bbc.co.uk/go/tab/pipeline/history/adhere-build)

## Development

Please raise pull requests with changes in rather than committing directly to `main`.

## Versioning

See [VERSIONING.md](VERSIONING.md)

We use [Semantic Versioning](https://semver.org/) for this repository

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md)

Please ensure you have run the test suite before submitting a Pull Request, and include a version bump in line with our [Versioning](#versioning) policy.

## License

See [LICENSE.md](LICENSE.md)

This is licensed under the Apache 2.0 License.

## Copyright

Copyright (c) 2020 BBC
18 changes: 18 additions & 0 deletions VERSIONING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Versioning & Releasing

Increments in the version should be done by one of the project owners.

The version should follow the standard `major.minor.patch` style, see http://semver.org/ for which defines the specification. The examples below are a paraphrasing of that specification.

# Examples of changes that would warrant a `patch` version changes

* Small changes that are completely backwards compatible, normally bug fixes.
* changes in dependencies

# Examples of changes that would warrant a `minor` version changes

* Introduction of new functionality, without breaking backwards compatibility.

# Examples of changes that would warrant a `major` version changes

* Any break in backwards compatibility must result in an increment of the `major` version.
14 changes: 14 additions & 0 deletions build-pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e

source /usr/local/nvm/nvm.sh
nvm install 12.12.0
nvm use 12.12.0


# Install & Build
npm install
npm run-script test
npm run-script build
echo Build completed
29 changes: 29 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

set -e

source /usr/local/nvm/nvm.sh
nvm install 12.12.0
nvm use 12.12.0

# Install & Build
npm install
npm run-script test
npm run-script build
echo Build completed

# Git Stuff
REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
echo REPO = $REPO
echo SSH_REPO = $SSH_REPO
cd dist
git init
git remote add origin $REPO
git symbolic-ref HEAD refs/heads/gh-pages
git fetch origin gh-pages
git reset
git config user.name "pas-gocd"
git add -A .
git commit -m "Deploy to gh-pages based on main. Build ${GO_PIPELINE_COUNTER}"
git push --set-upstream origin gh-pages -f

0 comments on commit 74f310b

Please sign in to comment.