nondanee / vsc-netease-music

UNOFFICIAL Netease Music extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=nondanee.vsc-netease-music
MIT License
1.02k stars 80 forks source link

ffmpeg electron #119

Open Jinghao1209 opened 2 years ago

Jinghao1209 commented 2 years ago

操作系统:macOS 作者大大,刚刚看到你的扩展想下载,下载了发现:Please interact with the document first otherwise play() will failed 看了一下,这是很正常的,所以我去了github.com/electron/electron的releases下载了我的vscode的electron版本13.5.2 问题来了,看了你的ffmpeg manual replace,想问下之后该怎么做呢?./Electron.app/Contents/Frameworks/Electron\ Framework.framework/Libraries/libffmpeg.dylib你的这个位置是指哪里呢?是指/Applications/Visual\ Studio\ Code.app/Contents/Frameworks/Electron\ Framework.framework/Libraries/下的libffmpeg.dylib吗? 我有去查了一下,vscode内建是没有ffmpeg的,所以我把下载下来的libffmpeg拖进那个地方,结果再次打开vscode时就被系统报错了,什么原因呢?就算把libffmpeg删除也无济于事......我就卡在这里了......(vscode我删除了,再下载过,默默的等待你的教学😂

nondanee commented 2 years ago

对的,就是用下载下来的 dylib 替换 vscode 里的 dylib

Electron.app/Contents/Frameworks/Electron\ Framework.framework/Libraries/libffmpeg.dylib

/Applications/Visual\ Studio\ Code.app/Contents/Frameworks/Electron\ Framework.framework/Libraries/libffmpeg.dylib

vscode 目录里是有这个文件的

替换后打不开 vscode 是签名问题,README 里有注明

VS Code for macOS 1.43+ 替换后闪退解决方案

nondanee commented 2 years ago

还是推荐用脚本自动替换

发现脚本有点问题,已经修好了

Jinghao1209 commented 2 years ago

新问题出现:闪退

$ ~ curl https://gist.githubusercontent.com/nondanee/f157bbbccecfe29e48d87273cd02e213/raw | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3528  100  3528    0     0  44467      0 --:--:-- --:--:-- --:--:-- 49000
vscode 1.64.1 arm64
electron 13.5.2
download well
replace done
remove temp

这样,之后没有报错,可是闪退了,加了这个东东进去~/.zshrc,后,再:

$ ~ code .
/usr/local/bin/code: line 10: 17790 Killed: 9               ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"

无效....

nondanee commented 2 years ago

清除签名的代码执行一次就行了,不用加在 zshrc 里,要用管理员权限运行

Jinghao1209 commented 2 years ago

还是不可以....

#!/bin/bash
# filename: bash.bash

export VSCODE_INSTALLATION="/Applications/Visual Studio Code.app"
codesign --remove-signature "$VSCODE_INSTALLATION/Contents/MacOS/Electron"
codesign --remove-signature "$VSCODE_INSTALLATION/Contents/Frameworks/Code Helper.app"
codesign --remove-signature "$VSCODE_INSTALLATION/Contents/Frameworks/Code Helper (Renderer).app"
codesign --remove-signature "$VSCODE_INSTALLATION/Contents/Frameworks/Code Helper (GPU).app"

步骤

  1. Reinstall visual studio code and drag into /Applications folder
  2. Run command curl https://gist.githubusercontent.com/nondanee/f157bbbccecfe29e48d87273cd02e213/raw | python
  3. Run command sudo bash bash.bash
  4. Close and open again VS Code

Alert crash.

窗口已崩溃(原因:“crashed”,代码:“6”)
我们对此不便表示抱歉! 请重启该窗口以从上次停止的位置继续。

然后我退出程序再打开: 应用程序“Visual Studio Code.app”无法打开。

是我哪里做错了吗?

nondanee commented 2 years ago

啊这,m1 芯片我没试过,可能是有问题,等周一借同事电脑看看

你可以试试把把 vscode 里所有内容都 codesign --remove-signature

Jinghao1209 commented 2 years ago

好的,把他全部codesign --remove-signature这个不知道怎么做,等你~ (´ . .̫ . `)

Jinghao1209 commented 2 years ago

有进展了吗?

nondanee commented 2 years ago

搞忘了,下周一定 QAQ

nondanee commented 2 years ago

在 m1 的机器上试了下,真的不行

只要执行了 --remove-signature 就会报错无法打开,不知道是不是系统的问题,我自己在 Big Sur 上是可以的

看来得想别的办法了,但是我太菜了,我只会用 webview 播放

你用大佬做得这个吧,他这个不依赖 webview 的 https://github.com/YXL76/cloudmusic-vscode

Jinghao1209 commented 2 years ago

好可惜ouo.....

liudonghua123 commented 1 year ago

现在应该不需要了, vscode 新版本已经集成了 ffmpeg

image