We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10449
    • 956 Posts
    The way you embed the SWF is outdated. First of all, you should really use something like SWFObject, but more importantly, you need to add so.addParam(’allowfullscreen’,’true’);

    http://www.jeroenwijering.com/?item=Embedding_Flash

      • 19337
      • 18 Posts
      Ok, I changed the flvPlayer snippet and added the fullscreen mode, it works now.
      I found the swfobject snippet (http://www.modxcms.com/SWFObject-1815.html), but it is only playing swf files no flv files. Is there anything I can do changing that?

      Michel
        film:projekt ------------------- autodidakten
        • 24589
        • 5 Posts
        Hi All,

        I have recreated the FLVPlayer using SWFObject and the latest version of FLV Media Player. It isn’t complete yet, but I figure it might help some of you.

        The get it to work grab the JW FLV Media player from here:
        http://www.jeroenwijering.com/?item=JW_FLV_Media_Player

        I uploaded it to: assets/snippets/mediaplayer

        Create a folder in assets called "video" and put your flv or mov files there (these are customizable btw)

        Then install the following snippet in the modx manager

        <?php
        /* 
        FlvMediaPlayer by Bruce Moyle 
        Based on FlashPlayer snippet by Mark & Bugaev and Matt Hobbs  and using Flash Media Player 
        http://www.jeroenwijering.com/?item=JW_FLV_Media_Player
         
        USAGE
        ------------------------------------
        
        [[FlvMediaPlayer?&file=f`ilename.flv` &width=`width` &height=`height` &image=`preview.jpg` &controls=`true` &autoplay=`true` &fullscreen=`true` &id=`clip1` &class=`css-class`]] 
        
        OPTIONS
        ------------------------------------
        
        &file = File name (MP3, H264, SWF, JPG, PNG, GIF supported - XML playlists coming soon)
        &path = use a different path or url for the file location. ie &path="http://www.video.org"
        &width = width in pixels
        &height = height in pixels
        &image = preview image (if you don't want an image for an mp3, then leave out)
        &controls = `true` or `false` - default is true
        &autoplay = `true` or `false`
        &fullscreen = `true` or `false` - Allows the use of fullscreen button
        &class = the div tag class for css formating
        &overstretch = `true` , `fit`, `false` or leave out to keep original aspect ratio and size.
        
        &id = name of the current clip handler
        
        Note about &id
        - This parameter is important if you wish to host separate instances of the player on the same page.
        - Set the &id to a unique name for each instance.
        - It isn't necessary if there is only one instance on each page.
        
        PATHS
        ------------------------------------
        */
        
        // $videoPath is the default directory to find your videos
        // This can be overwritten using &path option
        
        $videoPath="/assets/video";
        
        // $playerPath is where FLV Media Player is installed
        // Default should be /assets/snippets/mediaplayer
        
        $playerPath="/assets/snippets/mediaplayer";
        
        /*
        DEFAULT SETTINGS
        ------------------------------------
        */
        
        $width_default = "320";
        $height_default = "240";
        $controls_default = "true";
        $autoplay_default = "false";
        $fullscreen = "true";
        
        
        /* 
        THE CODE
        ------------------------------------
        */
        
        // CHECK INPUTS
        if (empty($width)) { $width=$width_default; }
        if (empty($height)) { $height=$height_default; }
        if (empty($controls)) { $controls=$controls_default; }
        if (empty($autoplay)) { $autoPlay=$autoplay_default; }
        if (empty($id)) { $id = "player"; }
        if (!empty($path)) { $videoPath = $path; }
        if (empty($overstretch)) { $overstretch = "false"; }
        
        // SETUP CONTROLS
        
        if ($controls == "true") { $height = $height + 20; }
        
        // CREATE SCRIPT
        
        $output = '
        <script type="text/javascript" src="'.$playerPath.'/swfobject.js"></script>
        
        <div id="'.$id.'" class="'.$class.'">
        <a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.
        </div>
        <script type="text/javascript">
        	var s1 = new SWFObject("'.$playerPath.'/mediaplayer.swf","mediaplayer","'.$width.'","'.$height.'","7");
        	s1.addParam("allowfullscreen","'.$fullscreen.'");
        	s1.addVariable("width","'.$width.'");
        	s1.addVariable("height","'.$height.'");
        	s1.addVariable("file","'.$videoPath.'/'.$file.'");
        	s1.addVariable("image","'.$videoPath.'/'.$image.'");
        	s1.addVariable("overstretch","'.$overstretch.'");
        	s1.write("'.$id.'");
        </script>
        ';
        
        return $output;
        ?>


        Have fun!... the next things to do are to get xml playlist working properly and detect audio files.
          • 19337
          • 18 Posts
          @Razorbolt

          Thank you very much, it is working great.

          Just a few things, it should be mentioned that the swfobject must be installed at the same place as the player.
          Would be good to add the: s1.addParam("wmode","transparent");

          Nice to have: the express-install feature.

          Michel
            film:projekt ------------------- autodidakten
            • 24589
            • 5 Posts
            Thanks Michelw,

            I’ll attempt to add more to it as I get the time. The transparent mode will be easy to add. As for an express install... never done one before, so not sure where to start.
              • 9726
              • 3 Posts
              Hi,

              I have finally got the player working on the site, which for some reason took ages.  Not sure why!

              But the problem I have now is that the autoplay is not working.  I have changed all the setting to "true", but still, when you access the player it will only start playing when you press play or click on the screen.

              Help would be GREATLY appreciated.

              I am only using one video per player by the way, in case it is something to do with multiple clips.

              Many thanks

              Update: FIXED
                • 26849
                • 16 Posts
                Has anyone else had browser issues with either the FlvPlayer snippet, or Razorbolt’s FlvMediaPlayer snippet? We have been testing on Mac’s and PC’s using a variety of browsers and have a bag of truly mixed results!

                On Windows XP:
                IE6 & IE7 refuse to work
                FF2 & FF3 work grudgingly using the FlvPlayer, as do Safari (Win) and Opera
                FlvMediaPlayer works only intermittently in FF3

                On a Mac:
                FlvPlayer works on Safari, FlvMediaPlayer does not
                FlvPlayer works on FF3, FlvMediaPlayer does not

                We are running MODx version 0.9.6.1p2

                Any help would be greatly appreciated!
                  • 3638
                  • 21 Posts
                  @sgt.bi1ko

                  I use a modification of the FlvPlayer Snippet and I use the Flash Flv Player (maxi version) from http://flv-player.net/en/


                  Get the file in attachment, you will need to upload the swf player file (player_flv.swf) and the xml configuration file (player_flv_config.xml) into your assets/flash/player folder.
                  Copy/paste contents of FlvPlayer.txt into a new snippet. Call [[FlvPlayer?flv_file=adeis.flv]] for example.

                  [EDIT] Your flv videos must be in the assets/flash/video folder, unless you modify the variable setting in the snippet

                  You can customize the player, just edit the xml configuration file. Value are explained there : http://flv-player.net/en/players/maxi/documentation/

                  Works on MODx version 0.9.6.1p2 with modern browser (IE6/7, Opera8/9, Firefox 2/3, Safari Mac 3/4, Safari Win 3)

                  Hope this help wink
                    • 33474
                    • 52 Posts
                    sorry for my english, i’m french

                    FlvPlayer use someone with a tv text ?
                      • 23018
                      • 353 Posts
                      Just in case anyone is interested in integrating the longtail "JW Player2:

                      If In understand the current licence terms right, then you have to buy a licence (about 30 bucks) if you your projects:

                      (i) has ads;
                      (ii) is a corporate site; or a
                      (iii) CMS.

                      If there is another meaning for CMS as "Content Management System" then I’m not aware of it. I’m waiting for a reply from the longtail video people and let you know what they told me. Until then I recommend to use something else...
                        Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe