We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Native
使用框架: React
Taro.chooseVideo({ sourceType: ['album','camera'], maxDuration: 8, camera: 'front', success: function (res) { res.tempFilePath.replace('.mov', '.mp4') var file = new File([res.tempFilePath], "video.mp4" ,{type: "video/mp4", lastModified: new Date}); console.log(file); const fileReader = new FileReader() fileReader.readAsDataURL(file) fileReader.onload = function () { const base64 = this.result.substring(this.result.indexOf(',') 1) console.log(base64); } }
选择视频后,最后返回一个base64
我现在是这样写的,虽然最后能输出一个很像base64的编码,但是解码后是坏的不能用
Taro v3.3.2 Taro CLI 3.3.2 environment info: System: OS: macOS 11.5.1 Shell: 3.2.57 - /bin/bash Binaries: Node: 14.17.4 - /usr/local/bin/node Yarn: 1.22.11 - /usr/local/bin/yarn npm: 6.14.14 - /usr/local/bin/npm npmPackages: @tarojs/components: 3.3.2 => 3.3.2 @tarojs/mini-runner: 3.3.2 => 3.3.2 @tarojs/react: 3.3.2 => 3.3.2 @tarojs/runtime: 3.3.2 => 3.3.2 @tarojs/taro: 3.3.2 => 3.3.2 @tarojs/webpack-runner: 3.3.2 => 3.3.2 babel-preset-taro: 3.3.2 => 3.3.2 eslint-config-taro: 3.3.2 => 3.3.2 react: ^17.0.0 => 17.0.2 react-native: ^0.64.0 => 0.64.2
The text was updated successfully, but these errors were encountered:
https://github.com/tanersener/react-native-ffmpeg 可对视频做转码,再转base64
Sorry, something went wrong.
No branches or pull requests
相关平台
React Native
使用框架: React
复现步骤
期望结果
选择视频后,最后返回一个base64
实际结果
我现在是这样写的,虽然最后能输出一个很像base64的编码,但是解码后是坏的不能用
环境信息
The text was updated successfully, but these errors were encountered: