Open VTT and media file from plugin
还没有人认领这个 Issue。
评估
调研方向
首先阅读 Main.OpenSubtitle、Main.SetSubtitle、Settings.RecentFiles 和 VideoPlayer.Initialize 附近的插件 API 使用情况。跟踪通过菜单打开字幕和媒体时,最近文件、保存目标和重启状态是如何更新的。完成标准是:插件可以通过预期的 API 打开这两种文件,并且正确的文件能够持久化、重新打开,并继续与保存操作保持关联。
由索引模型根据 Issue 内容生成。
描述
The first part of the problem that I'm running in to is opening the VTT (web based) in the app. Since Main.OpenSubtitle is hidden by the protection level I'm using Main.SetSubtitle. It opens just fine but when I go to save it seems to go to the latest entry in the Settings.RecentFiles. I've added my file(s) to the RecentFiles (and saving settings) but they don't display in the 'Reopen' menu and are lost when closing the app. Also, when the app is closed and restarted it reverts back to the last file opened from the menus.
Is there something I'm missing? Is there something in the plugin API that I should be using? I've also tried to change the protection level in SubtitleEdit source code to public but intellisense didn't pick up on it so it's unavailable. I probably have to compile and reference it but I'd like to do this the way it was intended rather than a source code change.
Second part is opening the media files (usually MP3 or WAV). I can't find any other way so I find the player control in Main and use VideoPlayer.Initialize to load the file. Seems to be the same issue (protection level).
Bottom line: how can I open files (subtitle and media) in a way that is consistent with opening the dialog box from the menu?
This code opens the MP3 file in the player but does not reopen after closing the app:
objVideoPlayer = (Nikse.SubtitleEdit.Controls.VideoPlayerContainer)objVP1s[0];
if (objVideoPlayer.VideoPlayer != null)
{
objVideoPlayer.VideoPlayer.Initialize(objVideoPlayer, strAudioFileName, EH1, EH2);
_parentForm.VideoAudioTrackNumber = 0;
}
This opens a VTT file but also does not reopen when the app is restarted nor will the correct file be written to when the save button is clicked:
Nikse.SubtitleEdit.Core.Common.Subtitle _subtitle = new Nikse.SubtitleEdit.Core.Common.Subtitle();
Encoding objEnc = Encoding.UTF8;
Nikse.SubtitleEdit.Core.Common.Subtitle objNEWST = new Core.Common.Subtitle();
_subtitle.LoadSubtitle(strTempVTTFileName, out objEnc, Encoding.UTF8);
- 主要语言
- C#
- 星标
- 138
- 派生
- 48
- 平均合并
- 2 分钟
- 30 天内合并 PR
- 6
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SubtitleEdit/plugins 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 45/100
SubtitleEdit/plugins#286 ·
-
难度 3/5 1-2 天 新手友好度 48/100
SubtitleEdit/plugins#283 ·
-
难度 5/5 一周以上 新手友好度 25/100
SubtitleEdit/plugins#274 ·
-
难度 3/5 1-2 天 新手友好度 25/100
SubtitleEdit/plugins#266 ·
-
难度 5/5 一周以上 新手友好度 25/100
SubtitleEdit/plugins#265 · 2 条评论 ·
查看 SubtitleEdit/plugins 的全部 Issue
相似的 Issue
-
type/automation type/tech-debt
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
area-integrations
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
:watch: Not Triaged dotnet-framework/svc install-deployment/subsvc
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复
-
has-image has-readme needs-attention new-tool repo-verified
难度 1/5 1-3 小时 新手友好度 62/100
shanselman/TinyToolTown#844 · 2 条评论 ·
维护者通常 3 天内回复
-
:watch: Not Triaged Pri3
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复