{"_id":"@els-studio/sanity-plugin-mux-input","_rev":"3-51a2a510cec0f76232d0882da5dc46b7","name":"@els-studio/sanity-plugin-mux-input","dist-tags":{"latest":"2.4.3"},"versions":{"2.4.0":{"name":"@els-studio/sanity-plugin-mux-input","version":"2.4.0","keywords":["sanity","video","mux","input","plugin","sanity-plugin","media"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"@els-studio/sanity-plugin-mux-input@2.4.0","maintainers":[{"name":"els-studio","email":"emma@els.studio"}],"homepage":"https://github.com/@els-studio/sanity-plugin-mux-input#readme","bugs":{"url":"https://github.com/@els-studio/sanity-plugin-mux-input/issues"},"dist":{"shasum":"bafd89de1a950afbdd1bdf2c098d6f7cf2ceff99","tarball":"https://registry.npmjs.org/@els-studio/sanity-plugin-mux-input/-/sanity-plugin-mux-input-2.4.0.tgz","fileCount":101,"integrity":"sha512-2gmUO/AA1ktsegS6tquTwetAkmfpmsHO4GY9U7jlnVsk4+FbaifSkdQd+/G3WERTJMkUU1GtOGbIWGivS7ZFBw==","signatures":[{"sig":"MEYCIQCWepKvyxhI+z2Zy3PlQlGOYIZbkdPP+sFHZ29sh+5t2AIhAOmrfvJJp1+BbvEICAwrCk82FW75darAtdEB48H0UuNj","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1257478},"main":"./dist/index.js","type":"commonjs","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"import":"./dist/index.mjs","source":"./src/_exports/index.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"60ff8f55b3afe73af907a1b48fd686d613cbc95e","scripts":{"dev":"plugin-kit link-watch --strict","lint":"eslint .","test":"npm run lint && npm run type-check && npm run build","build":"plugin-kit verify-package --silent && pkg-utils build --strict --check --clean","clean":"rimraf lib","watch":"pkg-utils watch --strict","format":"prettier --write --cache --ignore-unknown .","prepare":"husky install || true","link-watch":"plugin-kit link-watch","type-check":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"els-studio","email":"emma@els.studio"},"repository":{"url":"git+https://github.com/@els-studio/sanity-plugin-mux-input.git","type":"git"},"_npmVersion":"10.2.3","description":"An input component that integrates Sanity Studio with Mux video encoding/hosting service.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","browserslist":"extends @sanity/browserslist-config","dependencies":{"swr":"^2.2.5","rxjs":"^7.8.1","lodash":"^4.17.21","react-rx":"^4.1.5","iso-639-1":"^3.1.2","type-fest":"^4.18.2","@sanity/ui":"^2.1.11","@mux/upchunk":"^3.4.0","@sanity/uuid":"^3.0.2","@sanity/icons":"^3.0.0","suspend-react":"^0.1.3","jsonwebtoken-esm":"^1.0.5","use-error-boundary":"^2.0.6","@mux/mux-player-react":"^2.6.0","scroll-into-view-if-needed":"^3.1.0","@sanity/incompatible-plugin":"^1.0.4"},"sanityPlugin":{"verifyPackage":{"srcIndex":false}},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"yalc":"1.0.0-pre.53","husky":"^9.0.11","react":"^18.3.1","eslint":"^8.57.1","rimraf":"^5.0.7","sanity":"^3.68.1","prettier":"^3.4.2","react-is":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.7.2","lint-staged":"^15.2.2","@types/react":"^18.3.17","npm-run-all2":"^5.0.2","@types/lodash":"^4.17.13","@sanity/client":"^6.24.1","@sanity/vision":"^3.68.1","@types/react-is":"^18.3.1","semantic-release":"^24.2.0","@sanity/pkg-utils":"^6.12.1","styled-components":"^6.1.13","@sanity/plugin-kit":"4.0.19","eslint-config-sanity":"^7.1.3","eslint-plugin-import":"^2.31.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","eslint-config-react-app":"^7.0.1","@types/styled-components":"^5.1.34","@typescript-eslint/parser":"^7.18.0","eslint-plugin-react-hooks":"^5.1.0","prettier-plugin-packagejson":"^2.5.6","@sanity/semantic-release-preset":"^5.0.0","@typescript-eslint/eslint-plugin":"^7.18.0","eslint-plugin-simple-import-sort":"^12.1.1"},"peerDependencies":{"react":"^18","sanity":"^3.42.0","react-is":"^18","styled-components":"^5 || ^6"},"sanityExchangeUrl":"https://www.sanity.io/plugins/sanity-plugin-mux-input","_npmOperationalInternal":{"tmp":"tmp/sanity-plugin-mux-input_2.4.0_1738331684554_0.34854954792291193","host":"s3://npm-registry-packages-npm-production"}},"2.4.1":{"name":"@els-studio/sanity-plugin-mux-input","version":"2.4.1","keywords":["sanity","video","mux","input","plugin","sanity-plugin","media"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"@els-studio/sanity-plugin-mux-input@2.4.1","maintainers":[{"name":"els-studio","email":"emma@els.studio"}],"homepage":"https://github.com/els-studio/sanity-plugin-mux-input#readme","bugs":{"url":"https://github.com/els-studio/sanity-plugin-mux-input/issues"},"dist":{"shasum":"4c5a31db1a48223ff7f5f5e3f6349e48f1f34a7a","tarball":"https://registry.npmjs.org/@els-studio/sanity-plugin-mux-input/-/sanity-plugin-mux-input-2.4.1.tgz","fileCount":101,"integrity":"sha512-qwoMrVg/7BiqMJrMT/Lio2HvBWSIfqrXywKLeSDGCqGGeKE4MsBD7bP6ZzxJ2PEhsotjruQlJ2V42VRZvwA/VQ==","signatures":[{"sig":"MEUCIQDRfkhe2j9Zzx66N0awXoAavGC5V0DNTY/3DJtDFq0k5wIgOgNh17AqrNpGRcW0KbRVtZY9N93iL9XFspjXvmIThgg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1257475},"main":"./dist/index.js","type":"commonjs","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"import":"./dist/index.mjs","source":"./src/_exports/index.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"3e2a98416ced612fb41348950d2615294c41028d","scripts":{"dev":"plugin-kit link-watch --strict","lint":"eslint .","test":"npm run lint && npm run type-check && npm run build","build":"plugin-kit verify-package --silent && pkg-utils build --strict --check --clean","clean":"rimraf lib","watch":"pkg-utils watch --strict","format":"prettier --write --cache --ignore-unknown .","prepare":"husky install || true","link-watch":"plugin-kit link-watch","type-check":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"els-studio","email":"emma@els.studio"},"repository":{"url":"git+https://github.com/els-studio/sanity-plugin-mux-input.git","type":"git"},"_npmVersion":"10.2.3","description":"An input component that integrates Sanity Studio with Mux video encoding/hosting service.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","browserslist":"extends @sanity/browserslist-config","dependencies":{"swr":"^2.2.5","rxjs":"^7.8.1","lodash":"^4.17.21","react-rx":"^4.1.5","iso-639-1":"^3.1.2","type-fest":"^4.18.2","@sanity/ui":"^2.1.11","@mux/upchunk":"^3.4.0","@sanity/uuid":"^3.0.2","@sanity/icons":"^3.0.0","suspend-react":"^0.1.3","jsonwebtoken-esm":"^1.0.5","use-error-boundary":"^2.0.6","@mux/mux-player-react":"^2.6.0","scroll-into-view-if-needed":"^3.1.0","@sanity/incompatible-plugin":"^1.0.4"},"sanityPlugin":{"verifyPackage":{"srcIndex":false}},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"yalc":"1.0.0-pre.53","husky":"^9.0.11","react":"^18.3.1","eslint":"^8.57.1","rimraf":"^5.0.7","sanity":"^3.68.1","prettier":"^3.4.2","react-is":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.7.2","lint-staged":"^15.2.2","@types/react":"^18.3.17","npm-run-all2":"^5.0.2","@types/lodash":"^4.17.13","@sanity/client":"^6.24.1","@sanity/vision":"^3.68.1","@types/react-is":"^18.3.1","semantic-release":"^24.2.0","@sanity/pkg-utils":"^6.12.1","styled-components":"^6.1.13","@sanity/plugin-kit":"4.0.19","eslint-config-sanity":"^7.1.3","eslint-plugin-import":"^2.31.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","eslint-config-react-app":"^7.0.1","@types/styled-components":"^5.1.34","@typescript-eslint/parser":"^7.18.0","eslint-plugin-react-hooks":"^5.1.0","prettier-plugin-packagejson":"^2.5.6","@sanity/semantic-release-preset":"^5.0.0","@typescript-eslint/eslint-plugin":"^7.18.0","eslint-plugin-simple-import-sort":"^12.1.1"},"peerDependencies":{"react":"^18","sanity":"^3.42.0","react-is":"^18","styled-components":"^5 || ^6"},"sanityExchangeUrl":"https://www.sanity.io/plugins/sanity-plugin-mux-input","_npmOperationalInternal":{"tmp":"tmp/sanity-plugin-mux-input_2.4.1_1738332309887_0.5794157971547393","host":"s3://npm-registry-packages-npm-production"}},"2.4.2":{"name":"@els-studio/sanity-plugin-mux-input","version":"2.4.2","keywords":["sanity","video","mux","input","plugin","sanity-plugin","media"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"@els-studio/sanity-plugin-mux-input@2.4.2","maintainers":[{"name":"els-studio","email":"emma@els.studio"}],"homepage":"https://github.com/els-studio/sanity-plugin-mux-input#readme","bugs":{"url":"https://github.com/els-studio/sanity-plugin-mux-input/issues"},"dist":{"shasum":"c0d03148a5e68f861bac418dbcc62f93e967722a","tarball":"https://registry.npmjs.org/@els-studio/sanity-plugin-mux-input/-/sanity-plugin-mux-input-2.4.2.tgz","fileCount":101,"integrity":"sha512-KIPSRmRJrheSg59orh5ATMaqfEiZtprLjqr721dcMRAJUFh3JmN4JmW1mCj2qLIRsOwfH3NKSiw7xSxxroSFiw==","signatures":[{"sig":"MEUCICriqBaHmBaxUcDBwHj41mTLlbxceRhuWDFtMSB68BbfAiEA2U2ddU+yw5Y9if2lbBhz2YlHqfBfVwZortSKKMiTYKs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1208010},"main":"./dist/index.js","type":"commonjs","_from":"file:els-studio-sanity-plugin-mux-input-2.4.2.tgz","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"import":"./dist/index.mjs","source":"./src/_exports/index.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"dev":"plugin-kit link-watch --strict","lint":"eslint .","test":"npm run lint && npm run type-check && npm run build","build":"plugin-kit verify-package --silent && pkg-utils build --strict --check --clean","clean":"rimraf lib","watch":"pkg-utils watch --strict","format":"prettier --write --cache --ignore-unknown .","link-watch":"plugin-kit link-watch","type-check":"tsc --noEmit"},"_npmUser":{"name":"els-studio","email":"emma@els.studio"},"_resolved":"/private/var/folders/9r/lgnng2_x6_g00lfrw3d6f3dr0000gn/T/1028f6f5a3e357e933429a58420a73fd/els-studio-sanity-plugin-mux-input-2.4.2.tgz","_integrity":"sha512-KIPSRmRJrheSg59orh5ATMaqfEiZtprLjqr721dcMRAJUFh3JmN4JmW1mCj2qLIRsOwfH3NKSiw7xSxxroSFiw==","repository":{"url":"git+https://github.com/els-studio/sanity-plugin-mux-input.git","type":"git"},"_npmVersion":"10.2.3","description":"An input component that integrates Sanity Studio with Mux video encoding/hosting service.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","browserslist":"extends @sanity/browserslist-config","dependencies":{"swr":"^2.2.5","rxjs":"^7.8.1","lodash":"^4.17.21","react-rx":"^4.1.5","iso-639-1":"^3.1.2","type-fest":"^4.18.2","@sanity/ui":"^2.1.11","@mux/upchunk":"^3.4.0","@sanity/uuid":"^3.0.2","@sanity/icons":"^3.0.0","suspend-react":"^0.1.3","jsonwebtoken-esm":"^1.0.5","use-error-boundary":"^2.0.6","@mux/mux-player-react":"^2.6.0","scroll-into-view-if-needed":"^3.1.0","@sanity/incompatible-plugin":"^1.0.4","@els-studio/sanity-plugin-mux-input":"file:.yalc/@els-studio/sanity-plugin-mux-input"},"sanityPlugin":{"verifyPackage":{"srcIndex":false}},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"yalc":"1.0.0-pre.53","husky":"^9.0.11","react":"^18.3.1","eslint":"^8.57.1","rimraf":"^5.0.7","sanity":"^3.68.1","prettier":"^3.4.2","react-is":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.7.2","lint-staged":"^15.2.2","@types/react":"^18.3.17","npm-run-all2":"^5.0.2","@types/lodash":"^4.17.13","@sanity/client":"^6.24.1","@sanity/vision":"^3.68.1","@types/react-is":"^18.3.1","semantic-release":"^24.2.0","@sanity/pkg-utils":"^6.12.1","styled-components":"^6.1.13","@sanity/plugin-kit":"4.0.19","eslint-config-sanity":"^7.1.3","eslint-plugin-import":"^2.31.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","eslint-config-react-app":"^7.0.1","@types/styled-components":"^5.1.34","@typescript-eslint/parser":"^7.18.0","eslint-plugin-react-hooks":"^5.1.0","prettier-plugin-packagejson":"^2.5.6","@sanity/semantic-release-preset":"^5.0.0","@typescript-eslint/eslint-plugin":"^7.18.0","eslint-plugin-simple-import-sort":"^12.1.1"},"peerDependencies":{"react":"^18","sanity":"^3.42.0","react-is":"^18","styled-components":"^5 || ^6"},"sanityExchangeUrl":"https://www.sanity.io/plugins/sanity-plugin-mux-input","_npmOperationalInternal":{"tmp":"tmp/sanity-plugin-mux-input_2.4.2_1738810805515_0.3995149754063618","host":"s3://npm-registry-packages-npm-production"}},"2.4.3":{"name":"@els-studio/sanity-plugin-mux-input","version":"2.4.3","description":"An input component that integrates Sanity Studio with Mux video encoding/hosting service.","keywords":["sanity","video","mux","input","plugin","sanity-plugin","media"],"homepage":"https://github.com/els-studio/sanity-plugin-mux-input#readme","bugs":{"url":"https://github.com/els-studio/sanity-plugin-mux-input/issues"},"repository":{"type":"git","url":"git+https://github.com/els-studio/sanity-plugin-mux-input.git"},"license":"MIT","author":{"name":"Sanity.io","email":"hello@sanity.io"},"sideEffects":false,"type":"commonjs","exports":{".":{"source":"./src/_exports/index.ts","import":"./dist/index.mjs","default":"./dist/index.js"},"./package.json":"./package.json"},"main":"./dist/index.js","types":"./dist/index.d.ts","dependencies":{"@mux/mux-player-react":"^2.6.0","@mux/upchunk":"^3.4.0","@sanity/icons":"^3.0.0","@sanity/incompatible-plugin":"^1.0.4","@sanity/ui":"^2.1.11","@sanity/uuid":"^3.0.2","iso-639-1":"^3.1.2","jsonwebtoken-esm":"^1.0.5","lodash":"^4.17.21","react-rx":"^4.1.5","rxjs":"^7.8.1","scroll-into-view-if-needed":"^3.1.0","suspend-react":"^0.1.3","swr":"^2.2.5","type-fest":"^4.18.2","use-error-boundary":"^2.0.6"},"devDependencies":{"@sanity/client":"^6.24.1","@sanity/pkg-utils":"^6.12.1","@sanity/plugin-kit":"4.0.19","@sanity/semantic-release-preset":"^5.0.0","@sanity/vision":"^3.68.1","@types/lodash":"^4.17.13","@types/react":"^18.3.17","@types/react-is":"^18.3.1","@types/styled-components":"^5.1.34","@typescript-eslint/eslint-plugin":"^7.18.0","@typescript-eslint/parser":"^7.18.0","eslint":"^8.57.1","eslint-config-prettier":"^9.1.0","eslint-config-react-app":"^7.0.1","eslint-config-sanity":"^7.1.3","eslint-plugin-import":"^2.31.0","eslint-plugin-prettier":"^5.2.1","eslint-plugin-react-hooks":"^5.1.0","eslint-plugin-simple-import-sort":"^12.1.1","husky":"^9.0.11","lint-staged":"^15.2.2","npm-run-all2":"^5.0.2","prettier":"^3.4.2","prettier-plugin-packagejson":"^2.5.6","react":"^18.3.1","react-dom":"^18.3.1","react-is":"^18.3.1","rimraf":"^5.0.7","sanity":"^3.68.1","semantic-release":"^24.2.0","styled-components":"^6.1.13","typescript":"^5.7.2","yalc":"1.0.0-pre.53"},"peerDependencies":{"react":"^18","react-is":"^18","sanity":"^3.42.0","styled-components":"^5 || ^6"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"sanityExchangeUrl":"https://www.sanity.io/plugins/sanity-plugin-mux-input","browserslist":"extends @sanity/browserslist-config","sanityPlugin":{"verifyPackage":{"srcIndex":false}},"scripts":{"build":"plugin-kit verify-package --silent && pkg-utils build --strict --check --clean","clean":"rimraf lib","dev":"plugin-kit link-watch --strict","format":"prettier --write --cache --ignore-unknown .","link-watch":"plugin-kit link-watch","lint":"eslint .","test":"npm run lint && npm run type-check && npm run build","type-check":"tsc --noEmit","watch":"pkg-utils watch --strict"},"_id":"@els-studio/sanity-plugin-mux-input@2.4.3","_integrity":"sha512-HEbPPSRvWxQHLylT9Y++Y2EL7XmnuKZFigWoaW3eqNhzvVI79JO/nYKys2JnohdQl9xZeJ/5hieO6a90q5NBZA==","_resolved":"/private/var/folders/9r/lgnng2_x6_g00lfrw3d6f3dr0000gn/T/58e7890af20d4138b75c2591d01f1425/els-studio-sanity-plugin-mux-input-2.4.3.tgz","_from":"file:els-studio-sanity-plugin-mux-input-2.4.3.tgz","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-HEbPPSRvWxQHLylT9Y++Y2EL7XmnuKZFigWoaW3eqNhzvVI79JO/nYKys2JnohdQl9xZeJ/5hieO6a90q5NBZA==","shasum":"0e2df90c040e908ce4b1c566c28dbb19500b2b01","tarball":"https://registry.npmjs.org/@els-studio/sanity-plugin-mux-input/-/sanity-plugin-mux-input-2.4.3.tgz","fileCount":101,"unpackedSize":1207917,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD2PTrhCMem6G4hCVpil21XAg7q8x/wc+YdC2pmvAQBrQIgbaTn8nlq83qPLehy9PL2BXYgxobQ0TWqtGIUC4YZ31U="}]},"_npmUser":{"name":"els-studio","email":"emma@els.studio"},"directories":{},"maintainers":[{"name":"els-studio","email":"emma@els.studio"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sanity-plugin-mux-input_2.4.3_1738874841714_0.33606256704362725"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-31T13:54:44.478Z","modified":"2025-02-06T20:47:22.175Z","2.4.0":"2025-01-31T13:54:44.790Z","2.4.1":"2025-01-31T14:05:10.325Z","2.4.2":"2025-02-06T03:00:05.773Z","2.4.3":"2025-02-06T20:47:22.010Z"},"bugs":{"url":"https://github.com/els-studio/sanity-plugin-mux-input/issues"},"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","homepage":"https://github.com/els-studio/sanity-plugin-mux-input#readme","keywords":["sanity","video","mux","input","plugin","sanity-plugin","media"],"repository":{"type":"git","url":"git+https://github.com/els-studio/sanity-plugin-mux-input.git"},"description":"An input component that integrates Sanity Studio with Mux video encoding/hosting service.","maintainers":[{"name":"els-studio","email":"emma@els.studio"}],"readme":"# Mux Video Input Sanity Plugin\n\n> This is a **Sanity Studio v3** plugin.\n> For the v2 version, please refer to the [v2-branch](https://github.com/sanity-io/sanity-plugin-mux-input/tree/studio-v2).\n\nThis plugin lets you use [Mux](https://www.mux.com) video assets in your Sanity studio.\n\nThe Mux plugin for Sanity allows you to easily upload and preview videos.\n\n[Read our blog post](https://www.sanity.io/blog/video-management-with-mux) about this plugin.\n\nNot familiar with Sanity? [Visit www.sanity.io](https://www.sanity.io/)\n\n<img width=\"623\" alt=\"\" src=\"https://github.com/sanity-io/sanity/assets/81981/7a9de462-746b-4c01-8b12-c55f0cbf6334\">\n\n## Installation\n\n```\nnpm install sanity-plugin-mux-input\n```\n\nor\n\n```\nyarn add sanity-plugin-mux-input\n```\n\n## Quick start\n\n- While in your project folder, run `npm i sanity-plugin-mux-input`.\n  Read more about [using plugins in Sanity here](https://beta.sanity.io/docs/platform/studio/plugin).\n\n* Make a schema type that uses the plugin's type `mux.video`, for example:\n\n  ```js\n  export default {\n    title: 'Video blog post',\n    name: 'videoBlogPost',\n    type: 'document',\n    fields: [\n      {title: 'Title', name: 'title', type: 'string'},\n      {\n        title: 'Video file',\n        name: 'video',\n        type: 'mux.video',\n      },\n    ],\n  }\n  ```\n\n  - Add the `muxInput` import to your plugins:\n\n  ```js\n  import {defineConfig} from 'sanity'\n  import {muxInput} from 'sanity-plugin-mux-input'\n\n  export default defineConfig({\n    plugins: [muxInput()],\n  })\n  ```\n\nRead more about [schemas in Sanity here](https://www.sanity.io/docs/the-schema).\n\n- Get an API Access Token and enter it into the setup screen\n  First time you use the plugin you will be asked to enter your Mux credentials.\n\nThe Mux Video API uses an Access Token and Secret Key for authentication.\n\nIf you haven't already, generate a new Access Token in the Access Token settings of your Mux account dashboard, and make sure it got permission to both read and write _video_ and read _data_.\n\nThe token is stored in the dataset as a document of the type `mux.apiKey` with the id `secrets.mux`.\nHaving the ID be non-root ensures that only editors are able to see it.\n\nThe Mux plugin will find its access tokens by fetching this document.\n\n## Fetching playback IDs and understanding the data structure\n\nWhen a Mux video is uploaded/chosen in a document via this plugin, it gets stored as a reference to the video document:\n\n```json\n// example document\n{\n  \"_type\": \"exampleSchemaWithVideo\",\n  // Example video field\n  \"myVideoField\": {\n    \"_type\": \"mux.video\",\n    \"asset\": {\n      \"_type\": \"reference\",\n      \"_weak\": true,\n      \"_ref\": \"4e37284e-cec2-406d-973c-fdf9ab1e5598\" // 👈 ID of the document holding the video's Mux data\n    }\n  }\n}\n```\n\nBefore you can display videos in your frontend, you need to follow these references to fetch the asset's playback ID, which will be used to create a player. Here's an example GROQ query to expand the video reference in the example data above:\n\n```groq\n// Example for fetching data above\n*[ _type == \"exampleSchemaWithVideo\" ] {\n  myVideoField {\n    asset-> {\n      playbackId,\n      assetId,\n      filename,\n    }\n  }\n}\n```\n\n💡 For more information on querying references, refer to the documentation on [Writing GROQ queries for references](https://www.sanity.io/docs/reference-type#96b949753900) or on [Sanity's GraphQL API](https://www.sanity.io/docs/graphql).\n\nFor reference, here's an example `mux.videoAsset` document:\n\n```json\n{\n  \"_id\": \"4e37284e-cec2-406d-973c-fdf9ab1e5598\",\n  \"_type\": \"mux.videoAsset\",\n  \"assetId\": \"7ovyI76F92n02H00mWP7lOCZMIU00N4iysDiQDNppX026HY\",\n  \"filename\": \"mux-example-video.mp4\",\n  \"status\": \"ready\",\n  \"playbackId\": \"YA02HBpY02fKWHDRMNilo301pdH02LY3k9HTcK43ItGJLWA\",\n  // Full Mux asset data:\n  \"data\": {\n    \"encoding_tier\": \"smart\",\n    \"max_resolution_tier\": \"1080p\",\n    \"aspect_ratio\": \"16:9\",\n    \"created_at\": \"1706645034\",\n    \"duration\": 25.492133,\n    \"status\": \"ready\",\n    \"master_access\": \"none\",\n    \"max_stored_frame_rate\": 29.97,\n    \"playback_ids\": [\n      {\n        \"id\": \"YA02HBpY02fKWHDRMNilo301pdH02LY3k9HTcK43ItGJLWA\",\n        \"policy\": \"signed\"\n      }\n    ],\n    \"resolution_tier\": \"1080p\",\n    \"ingest_type\": \"on_demand_url\",\n    \"max_stored_resolution\": \"HD\",\n    \"tracks\": [\n      {\n        \"max_channel_layout\": \"stereo\",\n        \"max_channels\": 2,\n        \"id\": \"00MKMC73SYimw1YTh0102lPJJp9w2R5rHddpNX1N9opAMk\",\n        \"type\": \"audio\",\n        \"primary\": true,\n        \"duration\": 25.45\n      },\n      {\n        \"max_frame_rate\": 29.97,\n        \"max_height\": 1080,\n        \"id\": \"g1wEph3CVvbJL01YNKzAWMyH8N1SxW00WeECGjqwEHW9g\",\n        \"type\": \"video\",\n        \"duration\": 25.4254,\n        \"max_width\": 1920\n      }\n    ],\n    \"id\": \"7ovyI76F92n02H00mWP7lOCZMIU00N4iysDiQDNppX026HY\",\n    \"mp4_support\": \"none\"\n  }\n}\n```\n\n## Playing videos in the frontend\n\nWe recommend using [Mux Player](https://www.mux.com/player) to properly display your videos, through packages like `@mux/mux-player` and `@mux/mux-player-react`. Here's an example of how you can use the Mux Player to display a video in a React component:\n\n```tsx\n'use client'\n\nimport MuxPlayer from '@mux/mux-player-react'\n\nexport default function MuxVideo({playbackId, title}: {playbackId?: string; title?: string}) {\n  if (!playbackId) return null\n\n  return <MuxPlayer playbackId={playbackId} metadata={title ? {video_title: title} : undefined} />\n}\n```\n\n💡 You can try these recommendations through the [Codesandbox example](https://codesandbox.io/s/github/sanity-io/sanity-plugin-mux-input/tree/main/example).\n\n## Configuring Mux Video uploads\n\n### Signed URLs (private playbacks)\n\nTo enable [signed URLs](https://docs.mux.com/docs/security-signed-urls) with content uploaded to Mux, you will need to check the \"Enable Signed Urls\" option in the Mux Plugin configuration. This feature requires you to set the API Access Token and Secret Key (as per the [Quick start](#quick-start) section).\n\n📌 **Note**: When the signed URL option is triggered, the plugin will cache a `signingKeyPrivate` in a private document in the dataset. This key is used by Mux to sign the uploads, and if it's incorrect your uploads will fail. If that's the case, you can delete the secrets document and try again:\n\n```bash\n# Using the Sanity CLI, delete the secrets, then re-open the plugin and configure it again\nsanity documents delete secrets.mux\n```\n\nMore information on signed URLs is available on Mux's [docs](https://docs.mux.com/docs/headless-cms-sanity#advanced-signed-urls)\n\n### MP4 support (downloadable videos or offline viewing)\n\nTo enable [static MP4 renditions](https://docs.mux.com/guides/video/enable-static-mp4-renditions), add `mp4_support: 'standard'` to the `options` of your `mux.video` schema type.\n\n```js\nimport {muxInput} from 'sanity-plugin-mux-input'\n\nexport default defineConfig({\n  plugins: [muxInput({mp4_support: 'standard'})],\n})\n```\n\nIf MP4 support is enabled in the plugin's configuration, editors can still choose to enable MP4 renditions on a per-video basis when uploading new assets.\n\nMP4 allows users to download videos for later or offline viewing. More information can be found on Mux's [documentation](https://docs.mux.com/guides/enable-static-mp4-renditions).\n\n### Video resolution (max_resolution_tier)\n\nTo edit [max_resolution_tier](https://docs.mux.com/api-reference#video/operation/create-direct-upload) to support other resolutions other than 1080p, add `max_resolution_tier: '1080p' | '1440p' | '2160p'` to the `options` of your `mux.video` schema type. Defaults to `1080p`.\n\n```js\nimport {muxInput} from 'sanity-plugin-mux-input'\n\nexport default defineConfig({\n  plugins: [muxInput({max_resolution_tier: '2160p'})],\n})\n```\n\nWhen uploading new assets, editors can still choose a lower resolution for each video than configured globally. This option controls the maximum resolution encoded or processed for the uploaded video. The option is particularly important to manage costs when uploaded videos are higher than `1080p` resolution. More information on the feature is available on Mux's [docs](https://docs.mux.com/guides/stream-videos-in-4k). Also, read more on this feature announcement on Mux's [blog](https://www.mux.com/blog/more-pixels-fewer-problems-introducing-4k-support-for-mux-video).\n\n### Encoding tier (smart or baseline)\n\nThe [encoding tier](https://docs.mux.com/guides/use-encoding-tiers) informs the cost, quality, and available platform features for the asset. You can choose between `smart` and `baseline` at the plugin configuration. Defaults to `smart`.\n\n```js\nimport {muxInput} from 'sanity-plugin-mux-input'\n\nexport default defineConfig({\n  plugins: [muxInput({encoding_tier: 'baseline'})],\n})\n```\n\nIf `encoding_tier: 'smart'`, editors can still choose to use the `baseline` encoding tier on a per-video basis when uploading new assets.\n\nMore information on the feature is available on Mux's [documentation](https://docs.mux.com/guides/use-encoding-tiers). Also, read more on the feature announcement on Mux's [blog](https://www.mux.com/blog/our-next-pricing-lever-baseline-on-demand-assets-with-free-video-encoding)\n\n### Auto-generated subtitles and captions\n\nIf you've enabled smart encoding, you can use Mux's [auto-generated subtitles](https://docs.mux.com/guides/video/auto-generated-subtitles) feature. Unless you pass `disableTextTrackConfig: true` to the configuration, users will be able to choose a language to auto-generate subtitles for uploaded videos. Refer to Mux's documentation for the list of supported languages.\n\nYou can also define a default language for the upload configuration form:\n\n```js\nimport {muxInput} from 'sanity-plugin-mux-input'\n\nexport default defineConfig({\n  plugins: [\n    muxInput({\n      encoding_tier: 'smart',\n      defaultAutogeneratedSubtitleLang: 'en', // choose from one of the supported languages\n    }),\n  ],\n})\n```\n\nIf your videos are always spoken in a specific language and you want to include captions by default, you can use `disableTextTrackConfig: true` together with `defaultAutogeneratedSubtitleLang` to transcribe captions for every uploaded asset without needing user interaction.\n\n## Contributing\n\nIssues are actively monitored and PRs are welcome. When developing this plugin the easiest setup is:\n\n1. Fork this repo.\n1. Create a studio v3 project: `npm create sanity@dev-preview`. Follow the prompts, starting out with the blog template is a good way to go.\n1. `cd` into your project directory, run `npm install && npm start` - your sanity studio should be running on http://localhost:3333.\n1. `cd` into the `plugins` directory of your project.\n1. Fork this repo and clone your fork into the `plugins` directory inside your project `git clone git@github.com:your-fork/sanity-plugin-mux-input.git`.\n1. Open `sanity.json`, go to the `plugins` array and add `mux-input`.\n1. Re-start the sanity studio server with `npm start`.\n1. Edit `schemas/post.js` and add follow the plugin documentation to add a `mux.video` type field.\n1. Your studio should reload, and now when you edit the plugin code it should reload the studio, when you're done creating a branch, put in a PR and a maintainer will review it. Thank you!\n\n### Publishing\n\nRun the [\"CI\" workflow](https://github.com/sanity-io/sanity-plugin-mux-input/actions/workflows/ci.yml).\nMake sure to select the main branch and check \"Release new version\".\n\nSemantic release will only release on configured branches, so it is safe to run release on any branch.\n\nOn the [studio-v2](/tree/studio-v2) branch this will result in:\n\n- a new version on the `latest` dist-tag.\n- running `yarn add sanity-plugin-mux-input` or `npm i sanity-plugin-mux-input` will fetch the new version.\n- running `sanity install mux-input` will fetch the new version.\n- studio-v3 users are unaffected.\n\nOn the [main](/tree/main) branch this will result in:\n\n- a new prerelease version on the `studio-v3` dist-tag.\n- running `yarn add sanity-plugin-mux-input@studio-v3` or `npm i sanity-plugin-mux-input@studio-v3` will fetch the new version.\n- running `sanity install mux-input` won't fetch the new version.\n\nAfter Studio v3 turns stable this behavior will change. The v2 version will then be available on the `studio-v2` dist-tag, and `studio-v3` is upgraded to live on `latest`.\n\n### Develop & test\n\nThis plugin uses [@sanity/plugin-kit](https://github.com/sanity-io/plugin-kit)\nwith default configuration for build & watch scripts.\n\nSee [Testing a plugin in Sanity Studio](https://github.com/sanity-io/plugin-kit#testing-a-plugin-in-sanity-studio)\non how to run this plugin with hotreload in the studio.\n\n### Release new version\n\nRun [\"CI & Release\" workflow](https://github.com/sanity-io/sanity-plugin-mux-input/actions/workflows/main.yml).\nMake sure to select the main branch and check \"Release new version\".\n\nSemantic release will only release on configured branches, so it is safe to run release on any branch.\n\n## License\n\nMIT-licensed. See LICENSE.\n","readmeFilename":"README.md"}