{"bugs":{"url":"https://github.com/raxjs/universal-api/issues"},"dist":{"shasum":"8d2b4c346362a29ba7786cfdc1fd65e9cf78a71c","tarball":"https://registry.npmjs.org/@uni/video/-/video-1.0.8-beta.0.tgz","fileCount":112,"integrity":"sha512-A6v0ZkS5YYHBqm+/ihEIS9DmzsZgAc3bdNibUs7U1agxiXTTPA5TI5u/QLSYrBgPGvEutsD3v9HosW5zy/tLdg==","signatures":[{"sig":"MEYCIQDBxICayvzmyyrXQ/L4VEouQDGd7ha/a6Ki5Xnrv+ntNwIhAN2eJWvFSUFrABq/9lMbygFPKuQbnss3QC9Wqg40K1MP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":221501},"main":"lib/index.js","name":"@uni/video","unpkg":"dist/index.js","author":{"name":"rax"},"module":"es/index.js","readme":"# chooseVideo \n\n [![npm](https://img.shields.io/npm/v/@uni/video.svg)](https://www.npmjs.com/package/@uni/video)\n\nTakes a video or selects a video from the mobile album.\n\n## Supported\n\n<img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" title=\"ali miniprogram\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\" title=\"wechatMiniprogram\" /> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\" title=\"bytedanceMicroApp\" /> <img alt=\"baiduSmartProgram\" src=\"https://img.alicdn.com/imgextra/i4/O1CN01jngdBb24yGv2Fu34G_!!6000000007459-2-tps-200-200.png\" width=\"25px\" height=\"25px\" title=\"baiduSmartProgram\" /> <img alt=\"kuaiShouMiniProgram\" src=\"https://gw.alicdn.com/imgextra/i4/O1CN01kzmJMM24jcFEzp5Wv_!!6000000007427-2-tps-200-200.png\" width=\"25px\" height=\"25px\" title=\"KuaiShouMiniProgram\" />\n\n## Install\n\n```bash\n$ npm install @uni/video --save\n```\nor\n```bash\n$ npm install @uni/apis --save\n```\n## Usage\n\n```javascript\nimport { chooseVideo } from '@uni/video';\n\nchooseVideo({\n  sourceType: ['album', 'camera'],\n  compressed: true,\n  camera: 'back',\n  maxDuration: 100,\n  success (res) {\n    console.log(res);\n  }\n});\n\n// promise\nchooseVideo({\n  sourceType: ['camera'],\n  compressed: false,\n  camera: 'front',\n  maxDuration: 20,\n}).then(res => {\n  console.log(res);\n});\n\n```\n\nYou can also import from the big package：\n```js\nimport { video } from '@uni/apis';\n\nvideo.chooseVideo({\n  sourceType: ['album', 'camera'],\n  compressed: true,\n  camera: 'back',\n  maxDuration: 100,\n  success (res) {\n    console.log(res);\n  }\n});\n\n// promise\nvideo.chooseVideo({\n  sourceType: ['camera'],\n  compressed: false,\n  camera: 'front',\n  maxDuration: 20,\n}).then(res => {\n  console.log(res);\n});\n\n```\n\n## Methods\n\n### `chooseVideo(options)`\n\n#### Arguments\n\n| Property | Type | Description | required | Default |\n| --- | --- | --- | --- | --- |\n| options | `object`  |  | ✘ | - |\n| options.sourceType | `Array<string>`  | The source of the video | ✘ | ['album', 'camera'] |\n| options.maxDuration | `number` | The maximum duration of a recorded video | ✘ | 60 |\n| options.success | `Function`  | The callback function for a successful API call | ✘ | - |\n| options.fail | `Function`  | The callback function for a failed API call | ✘ | - |\n| options.complete | `Function`  | The callback function used when the API call completed (always executed whether the call succeeds or fails) | ✘ | - |\n\n#### Special Arguments\n\n| Property | Type | Description | required | Default | Supported |\n| --- | --- | --- | --- | --- | -- |\n| options.camera | `string`  | Indicates the default camera to be enabled. can be 'back' or 'front' | ✘ | 'back' | <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\" title=\"bytedanceMicroApp\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\" title=\"wechatMiniprogram\" /> <img alt=\"baiduSmartProgram\" src=\"https://img.alicdn.com/imgextra/i4/O1CN01jngdBb24yGv2Fu34G_!!6000000007459-2-tps-200-200.png\" width=\"25px\" height=\"25px\" title=\"baiduSmartProgram\" /> <img alt=\"kuaiShouMiniProgram\" src=\"https://gw.alicdn.com/imgextra/i4/O1CN01kzmJMM24jcFEzp5Wv_!!6000000007427-2-tps-200-200.png\" width=\"25px\" height=\"25px\" title=\"KuaiShouMiniProgram\" /> |\n| options.compressed | `boolean`  | Indicates whether to compress the selected video file | ✘ | true | <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\" title=\"bytedanceMicroApp\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\" title=\"wechatMiniprogram\" /> <img alt=\"baiduSmartProgram\" src=\"https://img.alicdn.com/imgextra/i4/O1CN01jngdBb24yGv2Fu34G_!!6000000007459-2-tps-200-200.png\" width=\"25px\" height=\"25px\" title=\"baiduSmartProgram\" /> <img alt=\"kuaiShouMiniProgram\" src=\"https://gw.alicdn.com/imgextra/i4/O1CN01kzmJMM24jcFEzp5Wv_!!6000000007427-2-tps-200-200.png\" width=\"25px\" height=\"25px\" title=\"KuaiShouMiniProgram\" /> |\n\n#### Return\n\n| Property | Type | Description |\n| --- | --- | --- |\n| tempFilePath | `string`  | Temporary file path of the selected video |\n| duration | `number` | Duration of the selected video |\n| size | `number` | Amount of data of the selected video |\n| width | `number` | Returns the height of the selected video |\n| height | `number` | Returns the width of the selected video |\n\n# createVideoContext \n\n [![npm](https://img.shields.io/npm/v/@uni/video.svg)](https://www.npmjs.com/package/@uni/video)\n\nCreates the VideoContext object for the video.\n\n## Supported\n\n<img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" title=\"ali miniprogram\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\" title=\"wechatMiniprogram\" /> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\" title=\"bytedanceMicroApp\" /> <img alt=\"baiduSmartProgram\" src=\"https://img.alicdn.com/imgextra/i4/O1CN01jngdBb24yGv2Fu34G_!!6000000007459-2-tps-200-200.png\" width=\"25px\" height=\"25px\" title=\"baiduSmartProgram\" /> <img alt=\"kuaiShouMiniProgram\" src=\"https://gw.alicdn.com/imgextra/i4/O1CN01kzmJMM24jcFEzp5Wv_!!6000000007427-2-tps-200-200.png\" width=\"25px\" height=\"25px\" title=\"KuaiShouMiniProgram\" />\n\n## Install\n\n```bash\n$ npm install @uni/video --save\n```\nor\n```bash\n$ npm install @uni/apis --save\n```\n## Usage\n\n```javascript\nimport { createVideoContext } from '@uni/video';\n\nconst videoContext = createVideoContext('videoId');\n\n```\n\n\nYou can also import from the big package：\n```js\nimport { video } from '@uni/apis';\n\nconst videoContext = video.createVideoContext('videoId');\n\n```\n\n## Methods\n\n### `createVideoContext(id, context)`\n\n#### Arguments\n\n| Property | Type | Description | required | Default |\n| --- | --- | --- | --- | --- |\n| id | `string`  | The video components ID | ✔ |  - |\n| context | `object`  | The this object of the current component instance in custom components. It is used with the video component（only for wechat and bytedance） | ✘ | - |\n\n#### Return\n\n| Property | Type | Description |\n| --- | --- | --- |\n| videoContext | `VideoContext` | VideoContext is bound to an video component with an id, to work with the video component. |\n","exports":{".":{"web":"./es/web/index.js","default":{"import":"./es/index.js","default":"./es/index.js","require":"./lib/index.js"},"miniapp":"./es/ali-miniapp/index.js","baidu-smartprogram":"./es/baidu-smartprogram/index.js","bytedance-microapp":"./es/bytedance-microapp/index.js","wechat-miniprogram":"./es/wechat-miniprogram/index.js","kuaishou-miniprogram":"./es/kuaishou-miniprogram/index.js"},"./*":"./*"},"gitHead":"44f41978af01f03fa9acac8699989243f1d988eb","license":"BSD-3-Clause","typings":"types/index.d.ts","_npmUser":{"name":"rax-publisher","email":"rax-public@alibaba-inc.com"},"homepage":"https://github.com/raxjs/universal-api#readme","repository":{"url":"git+ssh://git@github.com/raxjs/universal-api.git","type":"git"},"_npmVersion":"8.19.3","description":"[![npm](https://img.shields.io/npm/v/@uni/video.svg)](https://www.npmjs.com/package/@uni/video)","directories":{},"maintainers":[{"name":"bunko","email":"gh@ian7.com"},{"name":"rax-publisher","email":"rax-public@alibaba-inc.com"}],"sideEffects":false,"_nodeVersion":"16.19.0","dependencies":{"@uni/action-sheet":"^1.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.en-US.md","_npmOperationalInternal":{"tmp":"tmp/video_1.0.8-beta.0_1684317365679_0.5059525145637624","host":"s3://npm-registry-packages"},"_id":"@uni/video@1.0.8-beta.0","version":"1.0.8-beta.0"}