Results 1 to 5 of 5

Thread: How to automatically resize the embedded vlc player

  1. #1
    Join Date
    Apr 2011
    Posts
    56

    How to automatically resize the embedded vlc player

    I am very curious to know about this thing. Like is it possible to resize the vlc media player. See when we resize the browser then will the vlc player get automatically resized on its own. Since many of the other embedded players do the same thing. So that’s why I wanted to know whether the same feature is present in the vlc? Please let me know about it as soon as possible. I am waiting for your suggestions.

  2. #2
    Join Date
    May 2008
    Posts
    913

    Re: How to automatically resize the embedded vlc player

    Yes I have personally tried this method and I must say that the method is quite simple and so for that what you will have to do is go and add a function to the window.on resize method. Also you will have to change the height and the width of the embedded player accordingly. So do have a look at the method that I have suggested. In case if you have any other doubt then please do feel free to ask it here I would be happy to answer your query.

  3. #3
    Join Date
    Apr 2011
    Posts
    110

    Re: How to automatically resize the embedded vlc player

    I am one of the users who have not got any success with any of the methods. I did try with many of the methods that are flashed in the internet. I did try changing the vlc.video.width and vlc.video.height but that also did not help me. I did try working on the different scripts but that also did not gave me any appropriate results. So that’s what I have to say here. Anyone who would like to help me here. If anyone has got some coding help then please do suggest something here.

  4. #4
    Join Date
    May 2008
    Posts
    860

    Re: How to automatically resize the embedded vlc player

    I am giving you a code which I found it to be very useful for you. So do have a look at the code that I have suggested here and I am sure it would be of great help for you. So do work on it and I am sure that it will give you the desired solution that you were looking for. Do try it.

    Code:
    <html>
    <head>
    <script src="VLCobject.js" type="text/javascript"></script>
    <script type="text/javascript">  
    videoEventKey = { VOLUME_UP: 42, VOLUME_DOWN: 45 };
    
    vlcPlayer = {
        my_vlc1: null,
        vlc_device1: null,
        container1: null,
    
        loadDefaultVideo:function() {
            this.my_vlc1 = new VLCObject("mymovie", "640", "480", "0.8.6");   
            this.my_vlc1.addParam("MRL","/usr/local/media/circuit_high_120.wmv");
            this.my_vlc1.write("vlccontent");
            this.vlc_device1 = document.getElementById(this.my_vlc1.getAttribute('id'));
            this.container1 = document.getElementById("container");
            this.container1.focus();
        }, 
    // most important thing to note here
        maximize_Video1:function() {
            if (this.my_vlc1 != null) {
                this.vlc_device1.style.width = "1288px";
                this.vlc_device1.style.height = "780px";
                this.container1.focus();
            }
        },
            
        minimize_Video1:function() {
            if (this.my_vlc1 != null) {    
                this.vlc_device1.style.width = "640px";
                this.vlc_device1.style.height = "480px";
                this.container1.focus();
              }
        },
    
        eventHandler:function(ev) {
            switch (ev.type) {
               case 'key1down':
                   switch (ev.keyCode) {
                      case videoEventKey1.VOLUME_UP:
                            this.maximise_Video1();
                          break;
                       case videoEventKey1.VOLUME_DOWN:
                            this.minimise_Video1();
                          break;
                  }
               break;
           }
            ev.cancelBubble = true;
        }
    }
    
    </script>
    <style>
    .vlccontent {
       position: absolute;
       top: 0px;
       left: 0px;
       width: 100%;
       height: 100%;
    }
    
    .container {
        position: absolute;
        top: 0px;
        left: 0px;
        width: 100%;
        height: 100%;
        background-color: #000;
    }
    </style>
    </head>
    
    <body onload="vlcPlayer.loadDefaultVideo()" onKeyDown="vlcPlayer.eventHandler(event)">
    <div id="container" class="container">
    <div id="vlccontent">This text is replaced by the VLC player.</div>
    </div>
    </body>
    </html>
    In case if it does not work then do let me know I will make some changes to the code and lets see whether that helps or not.

  5. #5
    Join Date
    Apr 2011
    Posts
    56

    Re: How to automatically resize the embedded vlc player

    Hey thanks a lot for the coding solution. Now i got to know where i was wrong here. So thanks a lot for reminding me about the same. I am very happy that this coding did really help me. Otherwise i was not sure where i could find such type of coding stuffs. So i appreciate that you all have helped me in the problem. So thanks a lot guys for solving out the issue for me. I am really very grateful for you all.

Similar Threads

  1. Embedded Quicktime player is not working properly on iPhone
    By Kungfu Pandey in forum Portable Devices
    Replies: 6
    Last Post: 28-12-2011, 11:23 AM
  2. Automatically update player mode for NBA 2K12
    By Jasseen in forum Video Games
    Replies: 3
    Last Post: 07-10-2011, 08:12 PM
  3. Ipod touch player starts automatically
    By Bricklayer in forum Portable Devices
    Replies: 5
    Last Post: 23-06-2010, 10:41 AM
  4. Automatically resize images from an XML
    By AZUL in forum Software Development
    Replies: 4
    Last Post: 22-01-2010, 10:03 PM
  5. How to add vob file embedded with player in HTML webpage?
    By Arlo in forum Software Development
    Replies: 2
    Last Post: 04-06-2009, 02:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,757,097.09358 seconds with 17 queries