Add compoenent on top of a Video

Hello all i am trying to add a JButton on top of a movie
but the button is not visible ,
can you help me with that ?
thank you
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import javax.media.Controller;
import javax.media.Manager;
import javax.media.MediaLocator;
import javax.media.Player;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
public class Test1 extends JPanel {
  private JComponent m_playerComp;
  private JPanel m_pnlDraw = new JPanel(new FlowLayout());
  private JLayeredPane layeredPane = new JLayeredPane();
  public Test1() {
    try {
      Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, new Boolean(true));
      String url = "file://D:\\blender\\books\\EnvMapMirroring-XviD.avi";
      Player player = Manager.createPlayer(new MediaLocator(url));
      player.realize();
      while (player.getState() != Controller.Realized) {
        try {
          Thread.sleep(100);
        } catch (InterruptedException e) {}
      m_playerComp = (JComponent) player.getVisualComponent();
      m_pnlDraw.setOpaque(false);
      m_pnlDraw.add(new JButton("aaaaaaaaaaaa"));
      setBackground(Color.BLACK);
      layeredPane.add(m_playerComp, new Integer(1));
      layeredPane.add(m_pnlDraw, new Integer(10));
      setLayout(null);
      add(layeredPane);
      player.start();
    } catch (Exception e) {
      System.out.println("Error creating player");
      e.printStackTrace();
      return;
  public void doLayout(){
    super.doLayout();
    layeredPane.setBounds(0, 0, getSize().width, getSize().height);
    m_playerComp.setBounds(0, 0, getSize().width, getSize().height);
    m_pnlDraw.setBounds(0, 0, getSize().width, getSize().height);
  public static void main(String[] args){
    Test1 t = new Test1();
    JFrame frame = new JFrame();
    frame.setUndecorated(true);
    frame.setLayout(new BorderLayout());
    frame.setBounds(0, 0, 1024, 768);
    frame.add(t, BorderLayout.CENTER);
    frame.setVisible(true);
    frame.validate();
}

i thinking that implementing my on PlayerVisualCompoenent (this called render ?)
but , what happens with different codec , a different VisualCompoenent will be called ?
and how can i do that
here is same code but using a glass pane
i dont see my button
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import javax.media.Controller;
import javax.media.Manager;
import javax.media.MediaLocator;
import javax.media.Player;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
public class Test1 extends JPanel {
  private JComponent m_playerComp;
  public JPanel m_pnlDraw = new JPanel(new FlowLayout());
  private JLayeredPane layeredPane = new JLayeredPane();
  public Test1() {
    try {
      Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, new Boolean(true));
//      String url = "file://Y:\\Movies\\500 Days Of Summer (720p)\\500.Days.Of.Summer.720p.BluRay.x264-METiS.mkv";
      String url = "file://D:\\blender\\books\\EnvMapMirroring-XviD.avi";
      Player player = Manager.createPlayer(new MediaLocator(url));
      player.realize();
      while (player.getState() != Controller.Realized) {
        try {
          Thread.sleep(100);
        } catch (InterruptedException e) {}
      m_playerComp = (JComponent) player.getVisualComponent();
      m_pnlDraw.setOpaque(false);
      m_pnlDraw.add(new JButton("aaaaaaaaaaaa"));
      setBackground(Color.BLACK);
//      layeredPane.add(m_playerComp, new Integer(1));
//      layeredPane.add(m_pnlDraw, new Integer(10));
      setLayout(null);
//      add(layeredPane);
      add(m_playerComp);
      player.start();
    } catch (Exception e) {
      System.out.println("Error creating player");
      e.printStackTrace();
      return;
  public void doLayout(){
    super.doLayout();
//    layeredPane.setBounds(0, 0, getSize().width, getSize().height);
    m_playerComp.setBounds(0, 0, getSize().width, getSize().height);
//    m_pnlDraw.setBounds(0, 0, getSize().width, getSize().height);
  public static void main(String[] args){
    Test1 t = new Test1();
    JFrame frame = new JFrame();
    frame.setUndecorated(true);
    frame.setLayout(new BorderLayout());
    frame.setBounds(0, 0, 1024, 768);
    frame.add(t, BorderLayout.CENTER);
    frame.setGlassPane(t.m_pnlDraw);
    t.m_pnlDraw.setVisible(true);
    frame.setVisible(true);
    frame.validate();
}

Similar Messages

  • It's cutting the top of my video off!

    I uploaded my video and it looks great but then when I move it up to the library for the last editing, it cuts off the top of my video. I'm interviewing a coach and part of his face is cut off. But when I put my mouse over the video, the video looks good. Then I push play and it cuts his face off.
    What am I doing wrong?

    Open the clip inspector for the clip (in your project) Go to the "Rotate, CROP, Ken Burns" tab of the inspector. Select FIT rather then CROP.
    You can also go into Project Properties and set FIT as the default for new clips that you add to the project.

  • Top half of video is missing on imported WMV files. Running  CS3 & Win XP Professional

    Top half of video is missing on imported .WMV  files. I'm running CS3 Adobe Premier Pro with Win XP Professional OS
    Hi all,
       I just installed my Adobe Premier Pro CS3 for the very first time. I then IMPORTED a WMV file into the Project Frame and  then Dragged & Dropped it into the Time Line. All the windows (or Frames) Project Frame, Source Frame and the mini-Project Frame show this video with the top half missing. I’m running Win XP Professional with the latest Service Packs installed.
    Please Help.
    Thanks
    Derek

    After Searching the net for a while here, I found a solution to the "Half Screen" problem!
    The half screen video problems seen while trying to play WMV files in my CS3 Adobe Premiere Pro program seems to have been due to a recent Windows software Security update made to it’s Windows Media Player programming. As soon as I removed that update, my WMV files now show normally within Adobe Premier Pro.
    If you wish to uninstall this Windows Patch / Security Update on Win XP Machines:
    No#1 Prior to removing/un-installing the file, shut off "Windows Automatic Updates" and set update preferences to manual. Thus in the future you can select which Updates you want to instal (and which one not to instal)  *remember to ignore the KB2834904 update in the future! That is at least until Widows fixes this Security Update / Patch.
    A) Go to "Add/Remove Programs" in Control Panel
    B) In the Add/Remove Programs, check the "Show Updates" box located at the top of that window
    C) Scroll down to "Windows XP Software Updates" and within that section, scroll down to "Security Update for Windows Media Player" KB2834904 (mine was dated 7-10-2013)
    D) Click on the REMOVE button and re-start your system.
    If using Win 7 Operating System: to remove this Patch / Security Update the file to remove is: KB2803821 - In Windows 7, go to "Add/Remove Programs" in Control Panel, click on the "View installed updates" link in the left sidebar, search for KB 2803821 and click REMOVE.
    Good luck everyone!
    Derek

  • Placing an Audio Spectrum Effect on top of a video.

    I'm wondering if it's possible to use the audio spectrum effect on top of a video layer. That is, the video is playing while there is an audio visualizer *on top* of it. My goal is to produce a video podcast, but add some style to it by having each podcast member have their voice synced to an audio visualizer while there are video clips playing in the background.
    Is this possible with After Effects, or any of Adobe's products at all? Every time I place an audio spectrum effect on, I can hear the audio of my video clips, but the visualizer refuses to show on top of anything other than the black background that appears the moment I activate the effect.
    Can anyone help? Thanks.

    Place the audio in the comp and then add a solid layer. (comp size)
    Next, go to Effects, Generate, "Audio Spectrum" or "Audio Waveform" depending on what you'd like.
    You can apply the waveform directly to the video layer, but placing it on a separate layer allows separate adjustment of both layers independently.
    There are quite a few parameters that can be adjusted, however the defaults should be fine for most things.
    Here's a nice tutorial on the effect:
       http://www.motionworks.com.au/2009/08/effect-audio-wavefor/
    --Desmond

  • Imovie 11: When moving clips from event to project, the top of the video clip is cut off.

    I'm working with a new project. When I add clips from an event to the project window, the top of the video clip is cut off.  Quite a bit of it is cut off.  It happens on every clip.  The aspect ratio is correct and I've set the video to fit in frame.  How can I fix this?  I would really appreciate any help.

    You may have stabilization turned on in the project. On one of the clips, click on the small gear icon at the start of the clip and select Clip Adjustments. In the Inspector that opens, uncheck the box "Smooth Clip Motion" against Stabilization. If this fixes it for you, do the same for the other clips.
    Also, it's a good idea to turn off certain preferences in iMovie>Preferences (an iMovie menu item). In the Browser tab uncheck the boxes for both "Automatically stabilize clips that have been analyzed" and "Apply rolling shutter correction for clips that have been analyzed". See this picture:
    The stabilization process causes a zoomed in effect on the video, as it has to "average" the pixels in order to smooth any shaky motion. You therefore lose a certain amount of the picture, depending on the extent of stabilization applied. Here's what iMovie Help states (in part) about this process:
    "iMovie stabilizes video by analyzing the camera motion in the video and then moving the picture the opposite way to steady it onscreen. In this process, iMovie zooms in on the picture slightly. The amount of unstable motion in the clip determines how much zooming is necessary.
    Zooming in crops out some of the picture, but you can fine-tune the level of stabilization to strike the right balance between keeping the video steady and retaining as much of the picture as possible."
    John

  • How to add a time stamp to a video edited in Photoshop CC?

    Hello fine ppl of Adobe communities.
    I was wondering how can you add a time stamp to a video when edited in PS CC, is it possible at all? I dont have premier but I do have PS and LR.
    Appreciate any help.
    thanks

    If you use File > Place Embedded, you'll be able to resize and place (move, rotate, etc.) images as appropriate in your open document with the added bonus of having them added as Smart Objects. (Note that using Smart Objects can greatly increase the file size of your document. Just be aware.)
    File > Place Embedded > resize and place (hold down Shift to constrain proportion as you resize) > confirm by clicking the checkmark or "commit" icon.
    For layers that already exist, right-click the layer in the Layers panel > Convert to Smart Object.

  • When I Share my project using QuickTime the top of my video is chopped off, how do i fix this?

    when I Share my project using QuickTime the top of my video is chopped off, how do i fix this?

    What version of Premiere Elements and on what computer operating system is it running?
    - Mac OSX; Premier Elements 11 v11
    Where is the audio in the project - numbered audio tracks, Narration Track, and/or Soundtrack? Any chance that you are using a XviD.avi file?
    - audio is either in the soundtrack , or in audio 2 when part of a video
    Besides the full properties of your source file including file extension, what are the full export settings that you are using presumably for Publish+Share/Computer/MPEG?
    - i was just using the default for MPEG, which is the NTSC DVD standard, file type MPEG2-DVD
    What player are you using? Does the file playback video and audio using the VLC player? Does the problem exist in a new project?
    - i have tried in quicktime and VLC, both have the same effect (picture works, staccato background noise).  I have not tried in another file, but will do so now.

  • Can you layer a photo on top of a video in the iMovie app on an iPhone or an iPad?

    Can you layer a photo on top of a video in the iMovie app on an iPhone or an iPad?

    Not without a third party app. You can search the app store for apps that let you caption and write on photos but there is no native functionality for this in iOS.

  • How to I add text on top of image? I am using pages version 5.2.2

    I am working on an apple desk top OSX version 10.9.4. Since the new pages version 5.2.2 came out, I have been unable to add text on top of an image. Can anyone help me? Thanks ahead of time.

    Pages v5 is not as flexible as Pages ’09 v4.3. If you want text over a free-standing image in your document, then you will need to place it in a Text Box, Shape, or other custom container created with the Unite, Intersect, Subtract, or Exclude items in the Arrange panel. Simply selecting the image and then, in the Arrange tab, stating move with text; setting wrap to none, and clicking back/ward — does not help.
    You will need one of the containers from the second sentence positioned on top of your image. Once your text is input and styled, select the Text Box and the image, then from the Arrange tab, select group to maintain your text/image spatial relationship. If you need the image and its text container to adapt to other text in your document, you can enable the wrap functionality that best suits your document goals.
    This can get interesting, because you can independently define the selected Text Box content as a text placeholder, and the image as a media placeholder. Save it as a template. When you open a new document with this template, you can drag and drop a new image onto the old one, and it is automatically scaled and replaced without effecting the Text Box content. You can then double-click the Text Box content and change it.

  • "Trimming off" the top of the video in iMovie?

    Alright, so I'm recording Minecraft(a video game) with Screenflow for a youtube video and editing in iMovie. Problem is, in the UI of minecraft, the version number is shown in the upper-left corner of the screen. I'd like to somehow "trim" the top sliver of the video off so it doesn't show this. Is that possible? I've tried cropping but the cropping options are inexcusably light and imposing a "black box" image on the top of the video is impossible because it doesn't allow your to "Stretch" the image properly. How can I go about doing this?

    So when you crop using the crop tool, you are getting a black rectangle after you apply the cropping? In searching the iMovie Help, these are the directions on how to use the Crop Tool in iMovie '11.
    To crop a video clip or still image:
    In the Project browser, select a video clip or photo, and then press the C key or click the Crop button.
    Click Allow Black if there are black borders on the image that you want to be able to include in your crop.
    Allow Black applies to photos only, not to video.
    In the viewer, click Crop, and then drag to resize and reposition the green cropping rectangle to focus on the part of the image you want.
    To resize the cropping rectangle, move the pointer to a corner of it until the pointer turns into a plus sign, and then drag.
    Click the Play button in the viewer to preview your work.
    When you’re satisfied with the crop, click Done.
    Whether you crop media in a project or an Event, you can change or remove the crop at any time by selecting the cropped photo or video, clicking the Crop button, and then making whatever changes you want.

  • I downloaded a web site isytd video downloader on my macbook pro, to download videos. but it didnt  work , so I removed the softwear from my mac, even I removed it the download sign appears on the left top of my video screen,  so I want to remove this

    I downloaded a web site isytd video downloader on my macbook pro, to download videos. but it didnt  work , so I removed the softwear from my mac, even I removed it the download sign appears on the left top of my video screen,  so I want to remove this download sign. How can I get this done? Please help me.

    Many apps are not completely removed if the .app file is trashed (which is what I believe you've done so far).
    If you don't want to dig through the system to manually remove library files, I recommend the use of AppCleaner, which does the job for you.

  • I hope to use Audition to add verbal instruction onto some exercise videos I've uploaded on Premiere

    I hope to use Audition to add verbal instruction onto some exercise videos I've uploaded on Premiere Pro - still working out the software so if you can help, please can you explain in simple terms.  Thanks so much.

    We need more more info for a detailed answer but the basic reply is "Yes".
    You will need a microphone and some form of audio interface (to plug the mic into the computer--built in sound cards and the included jacks are often not suitable for anything more than a gamer's mic).
    Export your Premiere Pro Project (Edit/Edit in Audition).  This'll take your video and existing audio across to Audition.
    Create a new track in Multitrack View, enable that for recording, route your mic/interface to that track then play the existing stuff to watch/listen to while your record your comments.
    When done you can either mix it in Audition or send all the stems back to Premier Pro--I usually mix in Audition but that's just because I now it better.
    I realise this is a very simplistic summary but you'll need to read up (or watch training videos) to get all the details.

  • Move "Add Document" to top

    Hello,
    I need to move "Add Document" to top of form library but cannot use SharePoint Designer nor any code. I'd like to use context editor but need to know exactly what script to use. Thanks in advance for any help.

    Hi,
    According to your post, my understanding is that you wanted to move the “Add Document” to top.
    You can add a content editor web part in the library, then use the following code snippet to achieve it.
    <style type="text/css">
    TABLE.s4-wpTopTable {
    POSITION: relative
    TD > DIV > TABLE {
    MARGIN-TOP: 25px
    TD.ms-addnew {
    POSITION: absolute; LEFT: 2px; TOP: 2px
    }</style>
    Thanks & Regards,
    Jason 
    Jason Guo
    TechNet Community Support

  • Can't figure out how to add bars to reformat 16:9 video to fit a 4:3 frame

    Hi all, I'm a long-time user of iMovie 5, and a professional Avid video editor. On my home computer, however, I have some serious issues using the "dumbed down" version of iMovie '08 which, unfortunately, it seems I must use if I want to avoid purchasing new software, and don't feel like trucking my personal work to the office.
    Usability issues aside, I'm at a total loss as to how to reformat my imported video clips. At the moment I have a .dv file which is exported from FCP in a 16:9 format. I want to take this into iMovie '08, format it to fit a 4:3 window, add it to a bunch of other clips, and export a finished 4:3 movie to then put on DVD.
    Importing is fine, editing is meh but works (sorry, I'm a snob), and exporting works fine, but I can't for the life of me figure out how to put a reformat on the video. The goal is to have black bars on the top and bottom of the video image, squeezing the anamorphic 16:9 video down so that people don't look vertically stretched in a 4:3 window.
    What I do NOT want to do is crop out any of the video footage. The goal is to keep all of the video, and just add the black to the top and bottom in order to make it look, well, normal. For the life of me, I can't figure it out. it looks like this would be something that the Crop / Fit tool does, but that won't let me extend the fit outside of the frame of the video, nor will it let me put a 16:9 fit inside of the 4:3 viewing window (I only have a 4:3 option when in 4:3 mode, and only have a 16:9 option when in 16:9 mode).
    Thank you very much for your insight.
    PS: Just as an aside, why on earth did apple move iMovie '08 away from timeline-based editing? The old iMovie versions were quite powerful editing suites in their own right - even with limited video and audio layers. The '08 version seems to just hate users who want to do anything remotely close to frame-specific edits.

    I guess I've got to add the flags back in somehow? The weird thing is that the movie is the correct aspect ratio in iTunes and Quicktime, just not iMovie '08.
    iTunes, QT Player, and previous versions of iMovie all relied on the "Current Display Size" setting to set the aspect ratio. (I.e., you can modify this setting and change the aspect ratio by merely changing the display size in QT Pro and re-saving the file for these apps.) Unfortunate, iMovie '08 looks for the flag for the main display/export, and, if Apple hasn't changed things, uses the "current display size" to set the aspect ratio of the thumbnails... Weird.
    How would I add those flags back in? Can I just open in quicktime and save a new copy? Or am I going to have to contact the original source of the material and have him export it again (with different settings? And what settings would those be? He's coming from FCP).
    If the content is of exceptional quality, you could try re-exporting it in MPEG Streamclip using the "Export to DV..." option. This will re-flag the file with the aspect ratio you select in the export window. Also, be advised that performing destructive edits in iMovie '08 that forces the data to be re-written to new containers will lose the flag in the process unless Apple has made some recent changes to avoid this.

  • How to avoid pop up appearing in the screen middle top when playing video full-screen ?

    I created a landing page with embedded video hosted on Vimeo. When I click to play the video full-screen there's always a pop up window in the middle top saying the meaning like Vimeo is playing full-screen, press escape to get out of it. I don't want that pop up from appearing, I am wondering if any code I can put on the embedded video to prevent the pop up ? Thank you very much.

    No, as a web developer, you can't tamper with that message. The point is to prevent a situation where the user is trapped in full screen, as would happen if full screen is initiated by the page and the page doesn't provide controls to exit full screen.
    If users trust the site in question, they can check the "Never ask me again for this domain" checkbox to avoid the message in the future.
    Users can also get rid of all such messages altogether:
    # Install Stylish and restart Firefox when prompted.
    #* https://addons.mozilla.org/firefox/addon/stylish/
    # Click the Stylish icon on the navigation toolbar and choose Write New Style, then Blank style.
    # Paste the following in the text box, give the style a name, then click the Save button.
    <pre><nowiki>
    @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
    #fullscr-toggler,
    #full-screen-warning-container {
    display: none !important
    </nowiki></pre>
    If you don't want to install an add-on, you can use the ''userChrome.css'' file instead, but I don't recommend it. In that file, the first line of the style should only appear once at the top.
    * http://kb.mozillazine.org/UserChrome.css

Maybe you are looking for