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
目前正在利用electron + vue + jsftp刻一個客戶端,其中想要做到一個preview圖片、影片的效果。 jsftp讀取檔案資料流出來確認是nodejs socket了,不過不太清楚該怎樣將他轉為video/image的方法
Ubuntu 16.04, vscode, electron, jsftp, vue-electron
如附上的程式碼
下面附上我的片段程式碼
程式碼
function streamVideo(){ let self = this; let mediaSource = new MediaSource() this.$refs.prviewVideo.src = window.URL.createObjectURL(mediaSource) jsftp.get('/var/lib/ltms/transtep/man/media/full/sample.mp4', function(err, socket){ if (err) throw new Error(); socket.on('data', buffer=>{ // 不清楚實作方式 }) }) }
The text was updated successfully, but these errors were encountered:
自己的問題自己解,也分享給其他人
function streamVideo(){ let self = this; this.$refs.prviewVideo.src = window.URL.createObjectURL(mediaSource) jsftp.get('/var/lib/ltms/transtep/man/media/full/sample.mp4', function(err, socket){ if (err) throw new Error(); let buffs = [] socket.on('data', buffer=>{ buffs.push(buffer) }) socket.on('close', (hasErr)=>{ if (hasErr) throw new Error(hasErr) console.log('read file over') let file = new Blob((buffs), {type:'video/mp4'}) self.$refs.prviewVideo.src = URL.createObjectURL(file) self.$refs.prviewVideo.onload = function(){ self.$refs.prviewVideo.play() } }) }) }
Sorry, something went wrong.
No branches or pull requests
目的
目前正在利用electron + vue + jsftp刻一個客戶端,其中想要做到一個preview圖片、影片的效果。
jsftp讀取檔案資料流出來確認是nodejs socket了,不過不太清楚該怎樣將他轉為video/image的方法
使用的工具
Ubuntu 16.04, vscode, electron, jsftp, vue-electron
嘗試過的解法
如附上的程式碼
程式碼
下面附上我的片段程式碼
程式碼
The text was updated successfully, but these errors were encountered: