home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
TVDatabase.GetRecordedTV question
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="pilehave" data-source="post: 479330" data-attributes="member: 71550"><p><strong>Still need help!</strong></p><p></p><p>It's me again <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" /></p><p></p><p>Still haven't got it working, I'll drop some code to see if anyone knows where it needs a fix.</p><p></p><p>The first function is fired when a user presses "play" in fullscreen-tv. This works. Now, this function calls the main thread (right?) and tells it to run a function, stop playback (this works) and start playback of the file.</p><p></p><p>So...go full screen, press play, select file, press enter, current playback stops, play file. This all works the FIRST time. When I'm done watching my new file and wants to press stop I get no response. Using escape a few times gets me back to windowed tv but controls are "jammed".</p><p></p><p>I keep getting this error now, and MP freezes and must be killed by terminating the process:</p><p></p><p></p><p></p><p>Here's a cookdown of the code:</p><p></p><p>[CODE]</p><p> private void oneClickPlayRecordings()</p><p> {</p><p> try</p><p> {</p><p> GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);</p><p> if (dlg == null) return;</p><p> dlg.Reset();</p><p> dlg.SetHeading("Recorded TV");</p><p> int counter = 0;</p><p></p><p> IList<Recording> recordings = Recording.ListAll();</p><p> foreach (Recording rec in recordings)</p><p> {</p><p> counter++;</p><p> GUIListItem item = new GUIListItem();</p><p> item.Label = rec.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat);</p><p> item.Label2 = rec.Title;</p><p> item.PinImage = "";</p><p> dlg.Add(item);</p><p> } </p><p> </p><p> dlg.DoModal(GUIWindowManager.ActiveWindow);</p><p> if (dlg.SelectedId > 0)</p><p> {</p><p> recordedFileName = recordings[dlg.SelectedId-1].FileName.ToString();</p><p> GUIWindowManager.SendThreadCallbackAndWait(RecordingPlayback, 0, 0, recordings[dlg.SelectedId-1].FileName);</p><p> }</p><p> }</p><p> catch (Exception ex)</p><p> {</p><p> Log.Error("PowerPlay - Error(4): " + ex.Message + "( " + ex.StackTrace + " )");</p><p> }</p><p></p><p> }</p><p></p><p></p><p> private int RecordingPlayback(int p1, int p2, object d)</p><p> {</p><p> if (g_Player.Playing)</p><p> {</p><p> g_Player.Stop();</p><p> GUIWindowManager.SendThreadCallbackAndWait(StartPlayback, 0, 0, d);</p><p> GUIWindowManager.ResetAllControls();</p><p> }</p><p> return 0;</p><p> }</p><p></p><p></p><p></p><p> private int StartPlayback(int p1, int p2, object d)</p><p> {</p><p> string fileName = d.ToString();</p><p> TvBusinessLayer layer = new TvBusinessLayer();</p><p> Recording rec = layer.GetRecordingByFileName(fileName);</p><p> Log.Info("PowerPlay - fil: " + rec.Title.ToString());</p><p> string fileRTSP = RemoteControl.Instance.GetUrlForFile(fileName);</p><p> Log.Info("PowerPlay - try to fetch stream " + fileRTSP);</p><p> if (g_Player.Play(fileRTSP, g_Player.MediaType.Recording))</p><p> {</p><p> g_Player.ShowFullScreenWindow();</p><p> OnPlayBackStarted(rec);</p><p> return 0;</p><p> }</p><p> else</p><p> {</p><p> return 0;</p><p> }</p><p></p><p> </p><p> }</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="pilehave, post: 479330, member: 71550"] [b]Still need help![/b] It's me again ;) Still haven't got it working, I'll drop some code to see if anyone knows where it needs a fix. The first function is fired when a user presses "play" in fullscreen-tv. This works. Now, this function calls the main thread (right?) and tells it to run a function, stop playback (this works) and start playback of the file. So...go full screen, press play, select file, press enter, current playback stops, play file. This all works the FIRST time. When I'm done watching my new file and wants to press stop I get no response. Using escape a few times gets me back to windowed tv but controls are "jammed". I keep getting this error now, and MP freezes and must be killed by terminating the process: Here's a cookdown of the code: [CODE] private void oneClickPlayRecordings() { try { GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); if (dlg == null) return; dlg.Reset(); dlg.SetHeading("Recorded TV"); int counter = 0; IList<Recording> recordings = Recording.ListAll(); foreach (Recording rec in recordings) { counter++; GUIListItem item = new GUIListItem(); item.Label = rec.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat); item.Label2 = rec.Title; item.PinImage = ""; dlg.Add(item); } dlg.DoModal(GUIWindowManager.ActiveWindow); if (dlg.SelectedId > 0) { recordedFileName = recordings[dlg.SelectedId-1].FileName.ToString(); GUIWindowManager.SendThreadCallbackAndWait(RecordingPlayback, 0, 0, recordings[dlg.SelectedId-1].FileName); } } catch (Exception ex) { Log.Error("PowerPlay - Error(4): " + ex.Message + "( " + ex.StackTrace + " )"); } } private int RecordingPlayback(int p1, int p2, object d) { if (g_Player.Playing) { g_Player.Stop(); GUIWindowManager.SendThreadCallbackAndWait(StartPlayback, 0, 0, d); GUIWindowManager.ResetAllControls(); } return 0; } private int StartPlayback(int p1, int p2, object d) { string fileName = d.ToString(); TvBusinessLayer layer = new TvBusinessLayer(); Recording rec = layer.GetRecordingByFileName(fileName); Log.Info("PowerPlay - fil: " + rec.Title.ToString()); string fileRTSP = RemoteControl.Instance.GetUrlForFile(fileName); Log.Info("PowerPlay - try to fetch stream " + fileRTSP); if (g_Player.Play(fileRTSP, g_Player.MediaType.Recording)) { g_Player.ShowFullScreenWindow(); OnPlayBackStarted(rec); return 0; } else { return 0; } } [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
TVDatabase.GetRecordedTV question
Contact us
RSS
Top
Bottom