Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Open VTT and media file from plugin

Aperta
#263 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
desktop

Direzione di ricerca

Inizia leggendo l’utilizzo dell’API dei plugin attorno a Main.OpenSubtitle, Main.SetSubtitle, Settings.RecentFiles e VideoPlayer.Initialize. Traccia il modo in cui l’apertura di sottotitoli e contenuti multimediali dal menu aggiorna i file recenti, le destinazioni di salvataggio e lo stato dopo il riavvio. Il lavoro è completato quando un plugin può aprire entrambi i tipi di file tramite l’API prevista e i file corretti persistono, vengono riaperti e rimangono associati al salvataggio.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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);

Lingua principale
C#
Stelle
137
Fork
48
Merge medio
5m
PR unite (30g)
6

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SubtitleEdit/plugins

Tutte le issue di SubtitleEdit/plugins

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.