Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 556355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:54:39+00:00 2026-05-13T11:54:39+00:00

I would like to create a custom XUL element named ‘video’ for a video

  • 0

I would like to create a custom XUL element named ‘video’ for a video editing application based on XULRunner. In the XPCOM documentation it is explained how to access your component from Javascript, but I can’t seem to find any documentation on how to declare a new XUL element. Where can I find this? Can anyone point me in the right direction?

Clarification
I want to be able to connect a GStreamer pipeline to a XUL widget. This needs to be done from the C++ part of my application. In essence it boils down to the call:

gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(mOverlay), (gulong)windowId);

So what I need to achieve is a way to access a windowId (HWND on Windows) from a XUL widget. Does such a minimal requirement (accessing the window id for a XUL component) truly require me to create NPAPI plugin? Creating an NPAPI plugin seems somewhat daunting (but probably doable thanks to this project). I would like to avoid overkill, so if a XPCOM component would suffice then that would be great.

Solved!
I found a way to do it in an XPCOM plugin. I discovered that it’s possible to obtain the native handle of the top-level XUL window. This requires some hackery because you need to inluclude some of the private XUL headers in order to crack open de XUL element and obtain the window handle. But once you have it, you can create a child window.

The next challenge is to make the child window obey the layout manager of XUL. Since this window does not exists as a XUL element it won’t be affected by the layout manager at all. The workaround is to create a XUL element that will serve as a placeholder to overlay the native window on. For this element you then need to register a callback for the “resize” event. In the event handler you can make the size and position of your custom window to be the same as the XUL element.

I use XBL to define an element type with the name “video”. It contains a XUL label as only sub-element. This element is used in my XPCOM plugin as for the layouting described above.

This solution works pretty well.

Credit goes to Michael Smith of the Songbird team. He answered my question on the GStreamer mailing list. If you are interested you can look at this code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:54:39+00:00Added an answer on May 13, 2026 at 11:54 am

    You can’t implement a new XUL element using XPCOM. Your options are:

    • Use an existing element like HTML5 <video> or <canvas>. Here’s a demo of the two playing together. With the improved speed of JS engine it might be fast enough for your needs.
    • implement a new element using XBL (its content can only be a combination of other elements, plus custom APIs and style)
    • implement an NPAPI plugin and embed it via <object>. This allows you to handle painting and events in your C code. Examples of such plugins include Flash and the editing component (scintilla) in Komodo Edit and IDE.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a custom identity based off an custom identity. Or
I would like to create a custom XmlDeclaration while using the XmlDocument/XmlDeclaration classes in
hi i would like to create a custom calendar, this calendar will have custom
I would like to create an application wide keyboard shortcut for a Java Swing
I would like create a custom DataRow that will have -let's say- a propery
I would like to create a custom check box that functions just like a
I would like to create a custom document library where I use the standard
I would like to create a custom control in my Android App. It will
I would like to create a custom NSView that takes a layered approach to
I would like to create a custom button with framed caption in right top

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.