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 2
Plugin Development
Featured Plugins
WifiRemote
WifiRemote for MP2
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="FreakyJ" data-source="post: 1155261" data-attributes="member: 106003"><p>This is what I did:</p><p>[CODE=C#]case "subtitles":</p><p> if (Utils.IsNowPlaying())</p><p> {</p><p> ISubtitlePlayer subtitlePlayer = ServiceRegistration.Get<IPlayerContextManager>().PrimaryPlayerContext.CurrentPlayer as ISubtitlePlayer;</p><p> if (subtitlePlayer != null)</p><p> {</p><p> var availableSubtitlesList = subtitlePlayer.Subtitles.ToList();</p><p> int index = availableSubtitlesList.FindIndex(x => x == subtitlePlayer.CurrentSubtitle);</p><p> if (index == (availableSubtitlesList.Count - 1))</p><p> index = 0;</p><p> subtitlePlayer.SetSubtitle(availableSubtitlesList[index]);</p><p> }</p><p></p><p> }</p><p> break;</p><p></p><p> case "audiotrack":</p><p> if (Utils.IsNowPlaying())</p><p> {</p><p> ISharpDXVideoPlayer videoPlayer = ServiceRegistration.Get<IPlayerContextManager>().PrimaryPlayerContext.CurrentPlayer as ISharpDXVideoPlayer;</p><p> if (videoPlayer != null)</p><p> {</p><p> var availableAudiotracksList = videoPlayer.AudioStreams.ToList();</p><p> int index = availableAudiotracksList.FindIndex(x => x == videoPlayer.CurrentAudioStream);</p><p> if (index == (availableAudiotracksList.Count - 1))</p><p> index = 0;</p><p> videoPlayer.SetAudioStream(availableAudiotracksList[index]);</p><p> }</p><p></p><p> }</p><p> break;</p><p></p><p> /*case "screenshot":</p><p> button = Key.Screenshot;</p><p> break;*/</p><p></p><p> case "aspectratio":</p><p> if (Utils.IsNowPlaying())</p><p> {</p><p> ISharpDXVideoPlayer videoPlayer = ServiceRegistration.Get<IPlayerContextManager>().PrimaryPlayerContext.CurrentPlayer as ISharpDXVideoPlayer;</p><p> if (videoPlayer != null)</p><p> {</p><p> var availableGeometriesList = availableGeometries.Values.ToList();</p><p> int index = availableGeometriesList.FindIndex(x => x.Name == videoPlayer.GeometryOverride.Name);</p><p> if (index == (availableGeometriesList.Count - 1))</p><p> index = 0;</p><p> videoPlayer.GeometryOverride = availableGeometriesList[index];</p><p> }</p><p> </p><p> }</p><p> break;[/CODE]</p><p></p><p>But I am not sure if this is right <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite27" alt=":whistle:" title="Whistling :whistle:" loading="lazy" data-shortname=":whistle:" /></p><p></p><p>[USER=48495]@morpheus_xx[/USER] </p><p>Maybe a bit offtopic here, but hwile I am writing:</p><p>How do I get Fanart for a episode? I use this code:</p><p>[CODE=C#]IList<FanArtImage> fanart = ServiceRegistration.Get<IFanArtService>().GetFanArt(fanArtMediaType, fanartType, name, 0, 0, true);[/CODE]</p><p></p><p>And fet this in my log:</p><p></p><p>So "name" is the name of the Episode in the SeriesAspect. I also tried Thumbnail instead of Banner as a fallback, but same result. I could reverse the patterns for season, and seres, but not for an actual episode :/</p></blockquote><p></p>
[QUOTE="FreakyJ, post: 1155261, member: 106003"] This is what I did: [CODE=C#]case "subtitles": if (Utils.IsNowPlaying()) { ISubtitlePlayer subtitlePlayer = ServiceRegistration.Get<IPlayerContextManager>().PrimaryPlayerContext.CurrentPlayer as ISubtitlePlayer; if (subtitlePlayer != null) { var availableSubtitlesList = subtitlePlayer.Subtitles.ToList(); int index = availableSubtitlesList.FindIndex(x => x == subtitlePlayer.CurrentSubtitle); if (index == (availableSubtitlesList.Count - 1)) index = 0; subtitlePlayer.SetSubtitle(availableSubtitlesList[index]); } } break; case "audiotrack": if (Utils.IsNowPlaying()) { ISharpDXVideoPlayer videoPlayer = ServiceRegistration.Get<IPlayerContextManager>().PrimaryPlayerContext.CurrentPlayer as ISharpDXVideoPlayer; if (videoPlayer != null) { var availableAudiotracksList = videoPlayer.AudioStreams.ToList(); int index = availableAudiotracksList.FindIndex(x => x == videoPlayer.CurrentAudioStream); if (index == (availableAudiotracksList.Count - 1)) index = 0; videoPlayer.SetAudioStream(availableAudiotracksList[index]); } } break; /*case "screenshot": button = Key.Screenshot; break;*/ case "aspectratio": if (Utils.IsNowPlaying()) { ISharpDXVideoPlayer videoPlayer = ServiceRegistration.Get<IPlayerContextManager>().PrimaryPlayerContext.CurrentPlayer as ISharpDXVideoPlayer; if (videoPlayer != null) { var availableGeometriesList = availableGeometries.Values.ToList(); int index = availableGeometriesList.FindIndex(x => x.Name == videoPlayer.GeometryOverride.Name); if (index == (availableGeometriesList.Count - 1)) index = 0; videoPlayer.GeometryOverride = availableGeometriesList[index]; } } break;[/CODE] But I am not sure if this is right :whistle: [USER=48495]@morpheus_xx[/USER] Maybe a bit offtopic here, but hwile I am writing: How do I get Fanart for a episode? I use this code: [CODE=C#]IList<FanArtImage> fanart = ServiceRegistration.Get<IFanArtService>().GetFanArt(fanArtMediaType, fanartType, name, 0, 0, true);[/CODE] And fet this in my log: So "name" is the name of the Episode in the SeriesAspect. I also tried Thumbnail instead of Banner as a fallback, but same result. I could reverse the patterns for season, and seres, but not for an actual episode :/ [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Featured Plugins
WifiRemote
WifiRemote for MP2
Contact us
RSS
Top
Bottom