Web Browser Plugin (1 Viewer)

DalaNorth

Retired Team Member
  • Premium Supporter
  • December 18, 2006
    142
    1
    48
    Skellefteå, Sweden
    Home Country
    Sweden Sweden
    I think I have gotten the web browser working for 0.2.2.0 (or at least it works for me in the latest SVN :D ).

    Try this:

    (Note: If you already have the old version installed, please delete AxInterop.MOZILLACONTROLLib.dll and WebBrowser.dll from Plugins\Windows directory and uninstall the previous version of the Mozilla ActiveX Control before proceeding)

    Close MediaPortal
    Unzip the attached zip file in MediaPortal\Plugins\Windows
    Install the Mozilla ActiveX Control version 1.7.12
    Configure the plugin using MediaPortal Setup application before restarting MediaPortal.

    Information about the Mozilla ActiveX Control here:
    http://www.iol.ie/~locka/mozilla/control.htm

    Direct download of installation for ActiveX Control here:
    http://www.iol.ie/~locka/mozilla/MozillaControl1712.exe

    I will not be held responsible if something goes wrong...

    Good Luck!

    Regards
    DalaNorth
     

    Sh4nn0w

    MP Donator
  • Premium Supporter
  • September 14, 2006
    321
    23
    Home Country
    United Kingdom United Kingdom
    Works fine with SVN, but not with 0.2.2.0

    Gonna have a play around with this, looks good

    :D
     

    petsa

    MP Donator
  • Premium Supporter
  • January 23, 2007
    588
    15
    Stockholm
    Home Country
    Sweden Sweden
    Hi!

    It is great this plugin now works again! I hve two questions I'm sure you can help me answer:

    1. How do I navigate in the webpages? I have an MCE remote but I can't figure out how to use it as a mouse and click on links I'd like to follow.

    2. How come the lower 1/3rd is not used to display webpages? I use the BlueWide skin and it seems the plugin could make better use of the entire screen than it does for me today- Any preferences that I can tune?

    Thanks

    /Peter
     

    DalaNorth

    Retired Team Member
  • Premium Supporter
  • December 18, 2006
    142
    1
    48
    Skellefteå, Sweden
    Home Country
    Sweden Sweden
    1. I can't help you there since I don't have an MCE remote. I can tell you that using the keyboard, it's F9 to switch focus between navigation buttons and webpage, TAB to move between links on webpage and Enter to follow the active link.

    2. This is because the size of the browser window is hardcoded in the plugin. I hadn't noticed this before and will see if there is some way to make the size dynamic, depending on what skin you use.

    Regards
    DalaNorth
     

    Doron

    MP Donator
  • Premium Supporter
  • February 11, 2006
    206
    12
    Nahariya
    Home Country
    Israel Israel
    Can't get it work

    Did everything by the book. But when I open the browser in MP I get only a black screen with this error message in the middle "missing or invalid file".
     

    petsa

    MP Donator
  • Premium Supporter
  • January 23, 2007
    588
    15
    Stockholm
    Home Country
    Sweden Sweden
    Hi Doron,

    I used to get that as well. Can't remember exactly what I did but it now works. I also did the installation by the book, i.e. dropped all three .dlls in the plugins/windows directory and then installed the ActiveX stuff. Please remember to use the latest SNV for this.

    /Peter
     

    Doron

    MP Donator
  • Premium Supporter
  • February 11, 2006
    206
    12
    Nahariya
    Home Country
    Israel Israel
    Thanks Peter. I am using the latest release. Not the SVN. Maybe that is it.
    I never used the SVN. Is there noticeable instability?
     

    reagan+carter

    Portal Pro
    September 6, 2006
    221
    2
    Nantes, FR
    2. This is because the size of the browser window is hardcoded in the plugin. I hadn't noticed this before and will see if there is some way to make the size dynamic, depending on what skin you use.

    hello dalanorth,

    i had used (to some extents) the Internet Explorer webcontrol and needed this kind of feature (i.e. skin dependent resizing). This control was pretty nasty to correctly embed in a MediaPortal UI. A quick workaround I've tried was to stretch the control the size of a dummy MediaPortal GUIControl which, in turn, could be easily resized using skin XML entries.

    Code:
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Windows.Forms;
    using MediaPortal.GUI.Library;
    
    namespace MediaPortal.Messaging.Core
    
    {
    
        /// <summary>
        /// Simple webbrowser wrapper.
        /// </summary>
    
        public class GUIHTMLReader : GUIControl
    
        {
    
            WebBrowser HTMLReader;
    
            public String Document
            {
                get { return HTMLReader.DocumentText; }
                set { HTMLReader.DocumentText = value; }
            }
    
            public GUIHTMLReader(int dwParentID)
                : base(dwParentID)
            {
            }
    
            public GUIHTMLReader(int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight)
                : base(dwParentID, dwControlId, dwPosX, dwPosY, dwWidth, dwHeight)
            {
            }
    
            public override void AllocResources()
            {
    
                base.AllocResources();
    
                Log.Debug("GUIHTMLReader : AllocResources");
    
                //Create the actual generic container
                HTMLReader = new System.Windows.Forms.WebBrowser();
                HTMLReader.SetBounds(XPosition, YPosition, Width, Height);
                InitWebComponentOptions();
    
                this.IsVisible = false;
    
                GUIGraphicsContext.form.Controls.Add(HTMLReader);
            }
    
            void InitWebComponentOptions()
            {
                HTMLReader.AllowNavigation = false;
                HTMLReader.AllowWebBrowserDrop = false;
                HTMLReader.ScriptErrorsSuppressed = true;
                HTMLReader.WebBrowserShortcutsEnabled = false;
                HTMLReader.ScrollBarsEnabled = true;
            }
    
            public override void FreeResources()
            {
                base.FreeResources();
    
                Log.Debug("GUIHTMLReader : Dispose");
    
                HTMLReader.Dispose();
            }
    
            public override bool IsVisible
            {
                get
                {
                    return base.IsVisible;
                }
                set
                {
                    base.IsVisible = value;
                    if (value)
                        HTMLReader.Show();                    
                    else
                        HTMLReader.Hide();
                }
            }
    
        }
    
    }

    + in the Init() procedure of the plugin:

    Code:
            //Pre-register the simplecontainer control class so that the factory knows how to create it
            //It will be used as a container for the webbrowser component
            GUIControlFactory.RegisterControl("htmlreader", typeof(GUIHTMLReader));
            //Then load the GUI using the XML skin file
            bool bResult = Load(GUIGraphicsContext.Skin + @"\mymessage.xml");

    Then in the skin XML the webcontrol size could be specified and tweaked by skinners:

    Code:
    <control>
    <description>HTML frame area</description>
    <type>htmlreader</type>
    <id>52</id>
    <posX>260</posX>
    <posY>222</posY>
    <width>410</width>
    <height>300</height>
    </control>

    maybe this could be of any help
     

    Users who are viewing this thread

    Top Bottom