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
MediaPortal 1 Plugins
how can I show a video in my own plugin???
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="Naty" data-source="post: 157876" data-attributes="member: 50194"><p>Hi,</p><p>I'm trying to make a plugin which should show a video in a window in the middle of the screen and after switching to another menu item the video should be displayed in a small window in the left corner at the bottom of the screen. </p><p>Unfortunately it does not work at all and I am not able to find a explanation how to do this correctly anywhere. </p><p>Currently I have a black window, displayed on my screen - showing nothing and hearing nothing. </p><p>Is there anybody who could help me please? Many thanks in advance.</p><p></p><p>This is the code i wrote:</p><p></p><p><strong>XML-file:</strong></p><p>[CODE]<window></p><p> <id>0819</id></p><p> <defaultcontrol>2</defaultcontrol></p><p> <allowoverlay>yes</allowoverlay></p><p> <controls></p><p>...</p><p> <control> </p><p> <type>videowindow</type> </p><p> <description>video window</description> </p><p> <id>3001</id> </p><p> <posX>300</posX> </p><p> <posY>107</posY></p><p> <width>220</width> </p><p> <height>184</height></p><p> <colordiffuse>ffffffff</colordiffuse> </p><p> <onleft>2</onleft></p><p> <onright>2</onright> </p><p> </control></p><p> <control></p><p> <type>button</type></p><p> <description>Play Video</description></p><p> <id>3002</id></p><p> <posX>300</posX></p><p> <posY>300</posY></p><p> <width>20</width></p><p> <height>20</height></p><p> <textcolor>ff000000</textcolor></p><p> <textureFocus>osd_play_focus.png</textureFocus></p><p> <textureNoFocus>osd_play_nofocus.png</textureNoFocus></p><p> </control></p><p> <import>common.facade.video.xml</import></p><p> </controls></p><p></window></p><p>[/CODE]</p><p></p><p><strong>C#:</strong></p><p>[CODE]</p><p>using System;</p><p>using System.Collections.Generic;</p><p>using System.Text;</p><p>using System.Windows.Forms;</p><p>using MediaPortal.GUI.Library;</p><p>using MediaPortal.Dialogs;</p><p>using MediaPortal.Player;</p><p>//HANF - Home Automation Interoperability Framework</p><p>namespace Hanf_Video</p><p>{</p><p> public class Video : GUIWindow, ISetupForm</p><p> {</p><p> [SkinControlAttribute(8000)] protected GUIButtonControl buttonBeenden = null;</p><p> [SkinControlAttribute(3002)] protected GUIButtonControl buttonVideo = null;</p><p> protected GUIVideoControl contr= null;</p><p> public Video(){}</p><p> #region ISetupForm Members</p><p> public string PluginName()</p><p> {</p><p> return "HANF Video";</p><p> }</p><p> public override int GetID</p><p> {</p><p> get { return 0819;</p><p> } set {}</p><p> }</p><p>...</p><p> public bool CanEnable()</p><p> {</p><p> return true;</p><p> }</p><p> public int GetWindowId() { return 0819; }</p><p> public bool HasSetup() { return true; }</p><p> public bool GetHome(out string strButtonText, out string strButtonImage,</p><p> out string strButtonImageFocus, out string strPictureImage)</p><p> {</p><p> strButtonText = PluginName();</p><p> strButtonImage = String.Empty;</p><p> strButtonImageFocus = String.Empty;</p><p> strPictureImage = String.Empty;</p><p> return false;</p><p> }</p><p> public bool DefaultEnabled() { return true; }</p><p> public override bool Init()</p><p> {</p><p> return Load(GUIGraphicsContext.Skin + @"\Hanf_Video.xml");</p><p> }</p><p> protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)</p><p> {</p><p> if (control == buttonBeenden)</p><p> OnButtonBeenden();</p><p> if (control == buttonVideo)</p><p> OnButtonVideo();</p><p> base.OnClicked(controlId, control, actionType);</p><p> }</p><p></p><p> private void OnButtonBeenden()</p><p> {</p><p> GUIWindowManager.CloseCurrentWindow();</p><p> GUIWindowManager.ActivateWindow(0);</p><p> }</p><p> private void OnButtonVideo() {</p><p> if (contr != null) GUIGraphicsContext.VideoWindow = new System.Drawing.Rectangle( contr.XPosition, contr.YPosition, contr.Width, contr.Height); </p><p> g_Player.Play(@"C:\Program Files\Team MediaPortal\MediaPortal\Skin\BlueTwo\Media\Hanf\picture.mpeg");</p><p> }</p><p> #endregion</p><p> }</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="Naty, post: 157876, member: 50194"] Hi, I'm trying to make a plugin which should show a video in a window in the middle of the screen and after switching to another menu item the video should be displayed in a small window in the left corner at the bottom of the screen. Unfortunately it does not work at all and I am not able to find a explanation how to do this correctly anywhere. Currently I have a black window, displayed on my screen - showing nothing and hearing nothing. Is there anybody who could help me please? Many thanks in advance. This is the code i wrote: [B]XML-file:[/B] [CODE]<window> <id>0819</id> <defaultcontrol>2</defaultcontrol> <allowoverlay>yes</allowoverlay> <controls> ... <control> <type>videowindow</type> <description>video window</description> <id>3001</id> <posX>300</posX> <posY>107</posY> <width>220</width> <height>184</height> <colordiffuse>ffffffff</colordiffuse> <onleft>2</onleft> <onright>2</onright> </control> <control> <type>button</type> <description>Play Video</description> <id>3002</id> <posX>300</posX> <posY>300</posY> <width>20</width> <height>20</height> <textcolor>ff000000</textcolor> <textureFocus>osd_play_focus.png</textureFocus> <textureNoFocus>osd_play_nofocus.png</textureNoFocus> </control> <import>common.facade.video.xml</import> </controls> </window> [/CODE] [B]C#:[/B] [CODE] using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using MediaPortal.GUI.Library; using MediaPortal.Dialogs; using MediaPortal.Player; //HANF - Home Automation Interoperability Framework namespace Hanf_Video { public class Video : GUIWindow, ISetupForm { [SkinControlAttribute(8000)] protected GUIButtonControl buttonBeenden = null; [SkinControlAttribute(3002)] protected GUIButtonControl buttonVideo = null; protected GUIVideoControl contr= null; public Video(){} #region ISetupForm Members public string PluginName() { return "HANF Video"; } public override int GetID { get { return 0819; } set {} } ... public bool CanEnable() { return true; } public int GetWindowId() { return 0819; } public bool HasSetup() { return true; } public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { strButtonText = PluginName(); strButtonImage = String.Empty; strButtonImageFocus = String.Empty; strPictureImage = String.Empty; return false; } public bool DefaultEnabled() { return true; } public override bool Init() { return Load(GUIGraphicsContext.Skin + @"\Hanf_Video.xml"); } protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { if (control == buttonBeenden) OnButtonBeenden(); if (control == buttonVideo) OnButtonVideo(); base.OnClicked(controlId, control, actionType); } private void OnButtonBeenden() { GUIWindowManager.CloseCurrentWindow(); GUIWindowManager.ActivateWindow(0); } private void OnButtonVideo() { if (contr != null) GUIGraphicsContext.VideoWindow = new System.Drawing.Rectangle( contr.XPosition, contr.YPosition, contr.Width, contr.Height); g_Player.Play(@"C:\Program Files\Team MediaPortal\MediaPortal\Skin\BlueTwo\Media\Hanf\picture.mpeg"); } #endregion } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
how can I show a video in my own plugin???
Contact us
RSS
Top
Bottom