Skip to content

Commit

Permalink
chore: update package details and community files
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeocodes committed Mar 18, 2024
1 parent 9db166a commit 5cb4429
Show file tree
Hide file tree
Showing 7 changed files with 659 additions and 79 deletions.
76 changes: 0 additions & 76 deletions .github/CODE_OF_CONDUCT.md

This file was deleted.

361 changes: 361 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

131 changes: 131 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Code of Conduct

The Deepgram developer community is filled with amazing, clever and creative people, and we're excited for you to join us. Our goal is to create safe and inclusive spaces, have meaningful conversations, and explore ways to make sure that every voice is heard and understood.

#### Being a Good Community Member

Because we prioritize creating a safe space for our members, we believe in actively working on how we, as individuals, can ensure a positive community environment through our own actions and mindsets.

Every supportive community starts with each member. We feel it’s important to be open to others, respectful, and supportive. As part of the Deepgram community, please begin by thinking carefully about and agreeing with the following statements:

- I will be welcoming to everyone at the table;
- I will be patient and open to learning from everyone around me;
- I will treat everyone with respect, because they deserve it;
- I will be mindful of the needs and boundaries of others;

We strive to create a space where we learn and grow together. Here are some other key things you can do to make the community great:

### BE HUMBLE

People come from all different places, and it’s best not to make assumptions about what they think or feel. Approach others with curiosity and openness. We **all** have a lot to learn from each other.

### BE HELPFUL

If someone asks for help, consider jumping in. You don’t have to be an expert to talk through a problem, suggest a resource, or help find a solution. We all have something to contribute.

### ENCOURAGE OTHERS

There’s no one path to have a career in technology or to this community. Let’s engage others in ways that create opportunities for learning and fun for all of us.

## Our Pledge

Everyone who participates in our community must agree to abide by our Code of Conduct. By agreeing, you help create a welcoming, respectful, and friendly community based on respect and trust. We are committed to creating a harassment-free community.

These rules will be strictly enforced in any and all of our official spaces, including direct messages, social media, and physical and virtual events. Everyone who participates in these spaces is required to agree to this community code. We also ask and expect community members to observe these rules anywhere the community is meeting (for example, online chats on unofficial platforms or event after-parties).

## Our Standards

### BE RESPECTFUL

Exercise consideration and respect in your speech and actions. Be willing to accept and give feedback gracefully.

Don’t make offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, neuro(a)typicality, physical appearance, body size, race, ethnicity, immigration status, religion, experience level, socioeconomic status, nationality, or other identity markers.

Additionally, don’t insult or demean others. This includes making unwelcome comments about a person’s lifestyle choices and practices, including things related to diet, health, parenting, drugs, or employment. It’s not okay to insult or demean others if it’s "just a joke."

### BE WELCOMING AND OPEN

Encourage others, be supportive and willing to listen, and be willing to learn from others’ perspectives and experiences. Lead with empathy and kindness.

Don’t engage in gatekeeping behaviors, like questioning the intelligence or knowledge of others as a way to prove their credentials. And don’t exclude people for prejudicial reasons.

### RESPECT PRIVACY

Do not publish private communications without consent. Additionally, never disclose private aspects of a person’s personal identity without consent, except as necessary to protect them from intentional abuse.

### RESPECT PERSONAL BOUNDARIES

Do not introduce gratuitous or off-topic sexual images, languages, or behavior in spaces where they are not appropriate. Never make physical contact or simulated physical contact without consent or after a request to stop. Additionally, do not continue to message others about anything if they ask you to stop or leave them alone.

#### BE A GOOD NEIGHBOR

Contribute to the community in a positive and thoughtful way. Consider what’s best for the overall community. Do not make threats of violence, intimidate others, incite violence or intimidation against others, incite self-harm, stalk, follow, or otherwise harass others. Be mindful of your surroundings and of your fellow participants.

Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential.

# Additional rules for online spaces

For Deepgram’s official online spaces, like our YouTube & Twitch chats, we have some additional rules. Any of the following behaviors can result in a ban without warning.

### DON'T SPAM

Don't spam. We'll ban you.

### KEEP IT LEGAL

If it’s illegal, it’s not allowed on our websites or in our online spaces. Please don’t share links to pirated material or other nefarious things.

### NO TROLLING

Please be earnest. Don’t use excessive sarcasm to annoy or undermine other people. And don’t bait them with bad faith comments or abuse.

### PORNOGRAPHY AND OTHER NSFW STUFF

Please don’t post it or link to it. It doesn’t belong in our online spaces.

### FOUL AND GRAPHIC LANGUAGE

Please do not use excessive curse words. Additionally, do not use graphic sexual or violent language — again, think of our spaces as places for people of all ages.

# Enforcement & Reporting

If you are being harassed by a member of the Deepgram developer community, if you observe someone else being harassed, or you experience actions or behaviors that are contrary to our Code of Conduct, please report the behavior by contacting our team at [[email protected]](mailto:[email protected]).

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**_Community Impact:_** Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**_Consequence:_** A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**_Community Impact:_** A violation through a single incident or series of actions.

**_Consequence:_** A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**_Community Impact:_** A serious violation of community standards, including sustained inappropriate behavior.

**_Consequence:_** A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**_Community Impact:_** Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**_Consequence:_** A permanent ban from any sort of public interaction within the community.

# Attribution

This Code of Conduct is adapted from:

- Contributor Covenant, version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct
- https://eventhandler.community/conduct/, which itself is inspired by Quest, who in turn provides credit to Scripto, the #botALLY Code of Conduct, the LGBTQ in Tech code of Conduct, and the XOXO Code of Conduct.

Community Impact Guidelines, which were copied from InnerSource Commons, were inspired by Mozilla’s code of conduct enforcement ladder.

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
50 changes: 50 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Contributing Guidelines

Want to contribute to this project? We ❤️ it!

Here are a few types of contributions that we would be interested in hearing about.

- Bug fixes
- If you find a bug, please first report it using Github Issues.
- Issues that have already been identified as a bug will be labeled `🐛 bug`.
- If you'd like to submit a fix for a bug, send a Pull Request from your own fork and mention the Issue number.
- Include a test that isolates the bug and verifies that it was fixed.
- New Features
- If you'd like to accomplish something in the extension that it doesn't already do, describe the problem in a new Github Issue.
- Issues that have been identified as a feature request will be labeled `✨ enhancement`.
- If you'd like to implement the new feature, please wait for feedback from the project maintainers before spending
too much time writing the code. In some cases, `✨ enhancement`s may not align well with the project objectives at
the time.
- Tests, Documentation, Miscellaneous
- If you think the test coverage could be improved, the documentation could be clearer, you've got an alternative
implementation of something that may have more advantages, or any other change we would still be glad hear about
it.
- If its a trivial change, go ahead and send a Pull Request with the changes you have in mind
- If not, open a Github Issue to discuss the idea first.
- Snippets
- To add snippets:
- Add a directory in the `snippets` folder with the name of the language.
- Add one or more files in the language directory with snippets.
- Update the `package.json` to include the snippets you added.

We also welcome anyone to work on any existing issues with the `👋🏽 good first issue` tag.

## Requirements

For a contribution to be accepted:

- The test suite must be complete and pass
- Code must follow existing styling conventions
- Commit messages must be descriptive. Related issues should be mentioned by number.

If the contribution doesn't meet these criteria, a maintainer will discuss it with you on the Issue. You can still
continue to add more commits to the branch you have sent the Pull Request from.

## How To

1. Fork this repository on GitHub.
1. Clone/fetch your fork to your local development machine.
1. Create a new branch (e.g. `issue-12`, `feat.add_foo`, etc) and check it out.
1. Make your changes and commit them. (Did the tests pass? No linting errors?)
1. Push your new branch to your fork. (e.g. `git push myname issue-12`)
1. Open a Pull Request from your new branch to the original fork's `main` branch.
1 change: 0 additions & 1 deletion KNOWN_ISSUES.md

This file was deleted.

116 changes: 116 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# React NowPlaying

[![Discord](https://dcbadge.vercel.app/api/server/xWRaCDBtW4?style=flat)](https://discord.gg/xWRaCDBtW4)

A cross-browser cross-device friendly React context to auto-play audio in a browser.

## Demo / Development

This repo has a self-contained demo that does not get bundled with the package. To run this locally, you simply need to do the following;

```bash
# install dependencies
npm i

# run local demo
npm run dev
```

## Getting Started

### Installation

```bash
npm i react-nowplaying
```

### Add to your project

Import the React context provider;

```tsx
import { NowPlayingContextProvider } from "react-nowplaying";
```

And, just as any custom context provider, wrap the part of your app you need to be context aware in the custom provider's tags.

```tsx
// layout.tsx

//...

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>
<NowPlayingContextProvider>{children}</NowPlayingContextProvider> // e.g. custom provider tags wrap entire body of app
</body>
</html>
);
}
```

Now, you can provide your data `Blob` to the play function.

```tsx
export default function MyComponent() {
const { play } = useNowPlaying();

const playAudio = () => {
// get your audio blob
play(blob, "audio/mp3");
};

return (
<button type="button" onClick={() => playAudio()}>
Play Audio
</button>
);
}
```

## How It Works

In our recent project, we faced challenges with automatically playing audio across different browsers and devices, including Safari, Firefox, and all iOS devices. Our solution involved complex adjustments to enable automatic playback of audio files (in Blob format) received from our API. Instead of utilizing the Web Audio API, we opted for a workaround that involves a hidden audio element on the webpage. Here’s how it works:

- When audio is ready to play, the webpage updates a hidden audio element with the audio source and type, allowing the audio to play automatically.
- We created a custom hook that mimics the audio controls you'd find in the Web Audio API, making it easier to manage playback. This includes features for playing and finishing, with callbacks named onPlay and onFinish to handle these actions.
- Additionally, this custom hook provides a player object, which can be used to attach custom event handlers for more advanced audio control.

This approach allows for seamless audio playback across a wide range of browsers and devices, ensuring users have a consistent experience.

## Getting Help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:

- [Open an issue in this repository](https://github.com/deepgram-devs/deepgram-aura-tts-demo/issues)
- [Join the Deepgram Github Discussions Community](https://github.com/orgs/deepgram/discussions)
- [Join the Deepgram Discord Community](https://discord.gg/xWRaCDBtW4)

## Author

[Deepgram](https://deepgram.com)

## Known Issues

For a list of known issues and potential bugs, please visit our [Issues](https://github.com/deepgram-devs/react-nowplaying/issues) page. We regularly update this section as new issues are discovered and resolved.

## Collaborating

We welcome contributions from the community. For instructions on how to get involved, please read our [Collaborating Guide](CONTRIBUTING.md).

## Code of Conduct

To ensure a welcoming and safe environment for all contributors, we adhere to a Code of Conduct. All participants in our project are expected to read and follow our [Code of Conduct](CODE_OF_CONDUCT.md). We are committed to making participation in this project a harassment-free experience for everyone.

## Changelog

Stay updated with the changes and improvements made to our project by checking out our [Changelog](CHANGELOG.md). This document includes a detailed list of changes, including new features, bug fixes, and other important updates.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
"cross-browser",
"cross-device"
],
"author": "",
"author": "Luke Oliff <[email protected]> (https://deepgram.com)",
"license": "MIT",
"scripts": {
"dev": "concurrently --kill-others \"tsc-watch\" \"npm --prefix=demo/ run dev\"",
"preview-build": "tsc -p tsconfig.json && npm --prefix=demo/ run build",
"build": "tsc -p tsconfig.json"
},
"resolutions": {
Expand Down

0 comments on commit 5cb4429

Please sign in to comment.