Skip to content

Commit

Permalink
Merge branch 'main' into v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy authored Jul 31, 2023
2 parents d62a2cd + 3b3515c commit 61fd4e0
Show file tree
Hide file tree
Showing 22 changed files with 2,954 additions and 2,364 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ body:
description: Please check all the boxes that apply
options:
- label: I am using Expo
- label: I have read the [Troubleshooting Guide](https://mrousavy.github.io/react-native-vision-camera/docs/guides/troubleshooting)
- label: I have read the [Troubleshooting Guide](https://react-native-vision-camera.com/docs/guides/troubleshooting)
required: true
- label: I agree to follow this project's [Code of Conduct](https://github.com/mrousavy/react-native-vision-camera/blob/main/CODE_OF_CONDUCT.md)
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/QUESTION.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ body:
description: Please check all the boxes that apply
options:
- label: I am using Expo
- label: I have read the [Troubleshooting Guide](https://mrousavy.github.io/react-native-vision-camera/docs/guides/troubleshooting)
- label: I have read the [Troubleshooting Guide](https://react-native-vision-camera.com/docs/guides/troubleshooting)
required: true
- label: I agree to follow this project's [Code of Conduct](https://github.com/mrousavy/react-native-vision-camera/blob/main/CODE_OF_CONDUCT.md)
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
blank_issues_enabled: false
contact_links:
- name: Troubleshooting Guide
url: https://mrousavy.github.io/react-native-vision-camera/docs/guides/troubleshooting
url: https://react-native-vision-camera.com/docs/guides/troubleshooting
about: Please read the Troubleshooting Guide before opening an issue.
- name: VisionCamera Discussions
url: https://github.com/mrousavy/react-native-vision-camera/discussions
Expand Down
96 changes: 0 additions & 96 deletions .github/workflows/build-docs.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@

### Documentation

* [Guides](https://mrousavy.github.io/react-native-vision-camera/docs/guides)
* [API](https://mrousavy.github.io/react-native-vision-camera/docs/api)
* [Guides](https://react-native-vision-camera.com/docs/guides)
* [API](https://react-native-vision-camera.com/docs/api)
* [Example](./example/)

### Features

* Photo, Video and Snapshot capture
* Customizable devices and multi-cameras (smoothly zoom out to "fish-eye" camera)
* Customizable FPS
* [Frame Processors](https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors) (JS worklets to run QR-Code scanning, facial recognition, AI object detection, realtime video chats, ...)
* [Frame Processors](https://react-native-vision-camera.com/docs/guides/frame-processors) (JS worklets to run QR-Code scanning, facial recognition, AI object detection, realtime video chats, ...)
* Smooth zooming (Reanimated)
* Fast pause and resume
* HDR & Night modes
Expand Down Expand Up @@ -82,4 +82,4 @@ If you're integrating VisionCamera in a production app, consider [funding this p

<br />

#### 🚀 Get started by [setting up permissions](https://mrousavy.github.io/react-native-vision-camera/docs/guides/)!
#### 🚀 Get started by [setting up permissions](https://react-native-vision-camera.com/docs/guides/)!
12 changes: 6 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.5.2"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2"

implementation "androidx.camera:camera-core:1.1.0-beta02"
implementation "androidx.camera:camera-camera2:1.1.0-beta02"
implementation "androidx.camera:camera-lifecycle:1.1.0-beta02"
implementation "androidx.camera:camera-video:1.1.0-beta02"
implementation "androidx.camera:camera-core:1.1.0"
implementation "androidx.camera:camera-camera2:1.1.0"
implementation "androidx.camera:camera-lifecycle:1.1.0"
implementation "androidx.camera:camera-video:1.1.0"

implementation "androidx.camera:camera-view:1.1.0-beta02"
implementation "androidx.camera:camera-extensions:1.1.0-beta02"
implementation "androidx.camera:camera-view:1.1.0"
implementation "androidx.camera:camera-extensions:1.1.0"

implementation "androidx.exifinterface:exifinterface:1.3.3"

Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/com/mrousavy/camera/Errors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class NoCameraDeviceError : CameraError("device", "no-device", "No device was se
class InvalidCameraDeviceError(cause: Throwable) : CameraError("device", "invalid-device", "The given Camera device could not be found for use-case binding!", cause)
class ParallelVideoProcessingNotSupportedError(cause: Throwable) : CameraError("device", "parallel-video-processing-not-supported", "The given LEGACY Camera device does not support parallel " +
"video processing (`video={true}` + `frameProcessor={...}`). Disable either `video` or `frameProcessor`. To find out if a device supports parallel video processing, check the `supportsParallelVideoProcessing` property on the CameraDevice. " +
"See https://mrousavy.github.io/react-native-vision-camera/docs/guides/devices#the-supportsparallelvideoprocessing-prop for more information.", cause)
"See https://react-native-vision-camera.com/docs/guides/devices#the-supportsparallelvideoprocessing-prop for more information.", cause)

class FpsNotContainedInFormatError(fps: Int) : CameraError("format", "invalid-fps", "The given FPS were not valid for the currently selected format. Make sure you select a format which `frameRateRanges` includes $fps FPS!")
class HdrNotContainedInFormatError : CameraError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public abstract class FrameProcessorPlugin {
* The actual Frame Processor plugin callback. Called for every frame the ImageAnalyzer receives.
* @param frame The Frame from the Camera. Don't call .close() on this, as VisionCamera handles that.
* @return You can return any primitive, map or array you want. See the
* <a href="https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors-plugins-overview#types">Types</a>
* <a href="https://react-native-vision-camera.com/docs/guides/frame-processors-plugins-overview#types">Types</a>
* table for a list of supported types.
*/
@DoNotStrip
Expand Down
6 changes: 1 addition & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@ This command generates static content into the `build` directory and can be serv

## Deployment

```console
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
Docs are deployed to https://react-native-vision-camera.com using Next.js/Vercel.
2 changes: 1 addition & 1 deletion docs/docs/guides/LIFECYCLE.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';

The Camera's `isActive` property can be used to _pause_ the session (`isActive={false}`) while still keeping the session "warm". This is more desirable than completely unmounting the camera, since _resuming_ the session (`isActive={true}`) will be **much faster** than re-mounting the camera view.

For example, you want to **pause the camera** when the user **navigates to another page** or **minimizes the app** since otherwise the camera continues to run in the background without the user seeing it, causing **siginificant battery drain**. Also, on iOS a green dot indicates the user that the camera is still active, possibly causing the user to raise privacy concerns. (🔗 See ["About the orange and green indicators in your iPhone status bar"](https://support.apple.com/en-us/HT211876))
For example, you want to **pause the camera** when the user **navigates to another page** or **minimizes the app** since otherwise the camera continues to run in the background without the user seeing it, causing **significant battery drain**. Also, on iOS a green dot indicates the user that the camera is still active, possibly causing the user to raise privacy concerns. (🔗 See ["About the orange and green indicators in your iPhone status bar"](https://support.apple.com/en-us/HT211876))

This example demonstrates how you could pause the camera stream once the app goes into background using a [custom `useIsAppForeground` hook](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/src/hooks/useIsForeground.ts):

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/ZOOMING.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ A Camera device has different minimum, maximum and neutral zoom values. Those va
* The `neutralZoom` value is often `1`, but can be larger than `1` for devices with "fish-eye" (ultra-wide-angle) cameras. In those cases, the user expects to be at whatever zoom value `neutralZoom` is (e.g. `2`) per default, and if he tries to zoom out even more, he goes to `minZoom` (`1`), which switches over to the "fish-eye" (ultra-wide-angle) camera as seen in this GIF:

<div align="center">
<img src="https://developer.android.com/images/training/camera/multi-camera-4.gif" width="45%" />
<img src="/img/multi-camera.gif" width="45%" />
</div>

The Camera's `zoom` property expects values to be in the same "factor" scale as the `minZoom`, `neutralZoom` and `maxZoom` values - so if you pass `zoom={device.minZoom}` it is at the minimum available zoom, where as if you pass `zoom={device.maxZoom}` the maximum zoom value possible is zoomed in. It is recommended that you start at `device.neutralZoom` and let the user manually zoom out to the fish-eye camera on demand (if available).
Expand Down
52 changes: 47 additions & 5 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
module.exports = {
title: 'VisionCamera',
tagline: '📸 The Camera library that sees the vision.',
url: 'https://mrousavy.github.io',
baseUrl: '/react-native-vision-camera/',
url: 'https://react-native-vision-camera.com',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: './favicon.ico',
favicon: '/favicon.ico',
organizationName: 'mrousavy',
projectName: 'react-native-vision-camera',
themeConfig: {
algolia: {
apiKey: 'ab7f44570bb62d0e07c0f7d92312ed1a',
appId: 'HBHXBT6T9E',
apiKey: '64bc77eda92b7efcb7003b56815f1113',
indexName: 'react-native-vision-camera',
},
prism: {
Expand Down Expand Up @@ -87,25 +88,66 @@ module.exports = {
},
{
label: 'Marc\'s Portfolio',
href: 'https://mrousavy.github.io',
href: 'https://mrousavy.com',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Marc Rousavy`,
},
image: 'img/11.png',
metadata: [
{
name: 'keywords',
content: 'documentation, coding, docs, guides, camera, react, native, react-native'
},
{
name: 'og:title',
content: 'VisionCamera Documentation'
},
{
name: 'og:type',
content: 'application'
},
{
name: 'og:description',
content: '📸 The Camera library that sees the vision.'
},
{
name: 'og:image',
content: '/img/11.png'
},
],
announcementBar: {
id: 'support_us',
content:
'<b>I am currently working on <a target="_blank" href="https://github.com/mrousavy/react-native-vision-camera/issues/1376">VisionCamera V3 ✨</a> which brings a lot of new features and a full rewrite on Android. Please consider <a target="_blank" href="https://github.com/sponsors/mrousavy">sponsoring me on GitHub</a> so I can work on this.</b>',
backgroundColor: '#ff5c5c',
textColor: '#ffffff',
isCloseable: false,
},
},
presets: [
[
'@docusaurus/preset-classic',
{
sitemap: {
changefreq: 'weekly',
priority: 1.0,
ignorePatterns: ['/tags/**'],
filename: 'sitemap.xml',
},
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/mrousavy/react-native-vision-camera/edit/main/docs/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
gtag: {
trackingID: 'G-FX9Q0YKV7S',
anonymizeIP: false,
},
},
],
],
Expand Down
22 changes: 13 additions & 9 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"postinstall": "yarn install --cwd ..",
"docusaurus": "docusaurus",
"start": "TYPEDOC_WATCH=true docusaurus start",
"build": "docusaurus build",
Expand All @@ -12,12 +13,15 @@
"clear": "docusaurus clear"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-beta.14",
"@docusaurus/preset-classic": "^2.0.0-beta.14",
"@docusaurus/core": "^2.3.1",
"@docusaurus/plugin-google-gtag": "^2.3.1",
"@docusaurus/plugin-sitemap": "^2.3.1",
"@docusaurus/preset-classic": "^2.3.1",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@vercel/analytics": "^0.1.11",
"clsx": "^1.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"browserslist": {
"production": [
Expand All @@ -32,9 +36,9 @@
]
},
"devDependencies": {
"docusaurus-plugin-typedoc": "^0.16.6",
"typedoc": "^0.22.10",
"typedoc-plugin-markdown": "^3.11.8",
"typescript": "^4.5.4"
"docusaurus-plugin-typedoc": "^0.18.0",
"typedoc": "^0.24.0-beta.2",
"typedoc-plugin-markdown": "^3.14.0",
"typescript": "^4.9.5"
}
}
7 changes: 5 additions & 2 deletions docs/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
import styles from './styles.module.css';
import { Analytics } from '@vercel/analytics/react'

const features = [
{
Expand Down Expand Up @@ -56,8 +57,8 @@ function Home() {
const {siteConfig = {}} = context;
return (
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />">
title="VisionCamera Documentation"
description="📸 The Camera library that sees the vision.">
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">{siteConfig.title}</h1>
Expand Down Expand Up @@ -86,6 +87,8 @@ function Home() {
</div>
</section>
)}

<Analytics />
</main>
</Layout>
);
Expand Down
Binary file added docs/static/img/multi-camera.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/static/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# *
User-agent: *
Allow: /

# Host
Host: https://react-native-vision-camera.com

# Sitemaps
Sitemap: https://react-native-vision-camera.com/sitemap.xml
Loading

0 comments on commit 61fd4e0

Please sign in to comment.