We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19132
    • 199 Posts
    Down at the bottom of this nice snippet is this code:
    $file = $modx->config['site_url'] . $src;


    How do I change the line so that it points to an external file - in this case S3 at amazon web services - and yet allows me to use the src parameter to load the actual file?

    I love JWPlayer. What doesn’t work me is my server doesn’t do streaming nor psuedo-streaming. Hence I need to stream from S3 at amazon. I’m talking about huge 1.2gb files. They stream with another app that use the JWPlayer but that has so many TPLs to display in jQuery that it bends my mind.

    the JWPlayer snippet works great in highslide, but I can’t get it to automate in MODx.
      MySQL: 5.0.45
      PHP: 5.2.6
      Linux 2.6.9-023stab048.6-enterprise #1
      cURL enabled
      PDO enabled
      FFox Apple 3.6.8
      Firebug DIS-abled
      • 26931
      • 2,314 Posts
      hi there,

      thanks for this great snippet!

      is there a way to get it validate? i got a lot of errors resulting from the generated id from the div it’s applied to (removing that part from the snippet-code results in not working anymore): http://bit.ly/6giqTz

      and would it be possible to skin the player for playing mp3s? i set the configuration to
      &controlbar=bottom &height=20px &width=300px
      which works kinda...but i’ve still got a border on the bottom side i would like to get rid off, see here: http://bit.ly/5LUPpK

      thanks, j
        • 19132
        • 199 Posts
        I like this snippet. It’s easy to use. One thing some of my clients want though is autoplay. I checked the JWPlayer link above and didn’t find an autoplay script.
          MySQL: 5.0.45
          PHP: 5.2.6
          Linux 2.6.9-023stab048.6-enterprise #1
          cURL enabled
          PDO enabled
          FFox Apple 3.6.8
          Firebug DIS-abled
          • 14225
          • 12 Posts
          Hi there

          Many thanks for this great player.

          I have been trying to add an additional &image parameter to allow the player to show an image (the first frame of the video) instead of a black screen. I have tested this by adding the &image parameter to the snippet as follows:
          echo "so.addParam('flashvars','&file=$file&logo=$logosrc&skin=/upload/simple.swf&controlbar=$controlbar&fullscreen=$fullscreen&stretching=$stretching&autostart=false&image=/assets/images/test.jpg'); \n";
          which works perfectly.

          However I want to be able to change the image for each video I use (ie to display the first frame) but can’t seem to pass the &image value using the JWPlayer call. I have added the following lines of code to the snippet:
          $image = (isset($image)) ? strtolower($image) : "assets/images/test.jpg" ;   //Show image instead of blackscreen onload

           $imagesrc = $modx->config['site_url'].$image;

          And also added the calls &autostart=false&image=&imagesrc to this line:
          echo "so.addParam('flashvars','&file=$file&logo=$logosrc&skin=/upload/simple.swf&controlbar=$controlbar&fullscreen=$fullscreen&stretching=$stretching&autostart=false&image=&imagesrc'); \n";

          Finally I have added the &image parameter in the JW player call:
          [[JWPlayer? &src=[*videosrcArticle*]&height=[*videoheightArticle*]&width=[*videowidthArticle*]$controlbar=bottom&image=assets/images/test.jpg]]


          Unfortunately this doesn’t work - when I view the source of this page the value for &image hasn’t been passed the the flashvars so still reads:
          so.addParam('flashvars','&file=http://www.gamblingexclusive.com/assets/images/us/2010/poker/video/video.flv&logo=http://www.gamblingexclusive.com/assets/images/system/vidlogo.png&skin=/upload/simple.swf&controlbar=bottom&fullscreen=false&stretching=uniform&autostart=false&image=&imagesrc');


          Am I missing something? Any help would be greatly appreciated!

          Thanks.
            • 1329
            • 15 Posts
            Hello jj0101, thank you for your posting. I was looking for the same solution and you provided me with the part of code that I was missing. I revised your code and it now works for me. I have listed my changes below.

            Quote from: jj0101 at Jan 16, 2010, 03:00 PM

            However I want to be able to change the image for each video I use (ie to display the first frame) but can’t seem to pass the &image value using the JWPlayer call. I have added the following lines of code to the snippet:
            $image = (isset($image)) ? strtolower($image) : "assets/images/test.jpg" ;   //Show image instead of blackscreen onload


            This part above I removed so as not to conflict with the file directory input on the Resource Content/html page.


             $imagesrc = $modx->config['site_url'].$image;


            This part above I added.


            And also added the calls &autostart=false&image=&imagesrc to this line:
            echo "so.addParam('flashvars','&file=$file&logo=$logosrc&skin=/upload/simple.swf&controlbar=$controlbar&fullscreen=$fullscreen&stretching=$stretching&autostart=false&image=&imagesrc'); \n";


            This part above I added, but revised the "&image=&imagesrc" to read "&image=$imagesrc".


            Finally I have added the &image parameter in the JW player call:
            [[JWPlayer? &src=[*videosrcArticle*]&height=[*videoheightArticle*]&width=[*videowidthArticle*]$controlbar=bottom&image=assets/images/test.jpg]]


            This part above I added.
              • 8790
              • 526 Posts
              Hi,

              Early this year I launched a site (local High school) where I used the snippet :
              [[JWPlayer? &src=[*video*]  &player_id=`2`&width=`400` &height=`256` &autostart=`true` &backcolor=`006D89` &frontcolor=`ffffff &lightcolor=`ffff00`&screencolor=`003333`]]

              in this snippet I added a couple of extra parameters to meet my styling needs.
              <script type=\"text/javascript\"> 
              ...
              var so = new SWFObject('" . $jw_base . "embed/player.swf','mpl','$width','$height','9'); 
              so.addParam('allowscriptaccess','always');
              so.addParam('allowfullscreen','true'); 
              so.addParam('wmode','transparent');
              so.addParam('flashvars','&file=$file&image=$logosrc&skin=/upload/simple.swf&controlbar=$controlbar&fullscreen=$fullscreen&stretching=$stretching&autostart=$autostart&screencolor=$screencolor&lightcolor=$lightcolor&frontcolor=$frontcolor&backcolor=$backcolor');
              so.write(\"$file\"); 
              ...
              


              Everything is ok, hmm WAS ok but recently I found video were no more rendered in IE(8, in mode 8 or 7), as everything is still ok in FF or Chrome...

              swfobject is well loaded too by the snippet and appears into the rendered html but in IE the div where should be an embed or object is just empty !??? (right here in video only page for test purpose http://www.lyc-matisse-trappes.ac-versailles.fr/video-de-presentation.html)

              the snippet swfobject is
              Version:
               *   1.0.4 (embed SWFObject 2.0 final)
               * Date:


              I’m really in a bad situation if nothing is solve this summer.

              thank for any help
              EDIT: The situation is the same on all site using this snippet TOO !
                Schtroumpf Grognon - Grouchy Smurf
                ---------------------------------
                Faites pas attention.. - Don&#39;t pay attention
                http://www.dzi-neo.net
                • 8790
                • 526 Posts
                no one ?

                I can believe I’m alone to have the player disappearing in IE !
                (only IE 7,8,9 have issue)
                Looks like only swfobject1.5 will work with the snippet, the v2 gives the same result in ALL browsers(no player showed) as the 1.5 version gives in IE 7,8,9.
                I tested in an old IE6 (VM) and it’s working with the following generated code :

                <DIV class="jw_wrap" id="http://www.lyc-matisse-trappes.ac-versailles.fr/assets/files/video/matisse_small.flv"><OBJECT id="mpl" height="180" width="320" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
                <PARAM value="http://www.lyc-matisse-trappes.ac-versailles.fr/assets/snippets/JWPlayer/embed/player.swf" name="movie" />
                <PARAM value="high" name="quality" /><PARAM value="always" name="allowscriptaccess" /><PARAM value="true" name="allowfullscreen" />
                <PARAM value="transparent" name="wmode" />
                <PARAM value="&file=http://www.lyc-matisse-trappes.ac-versailles.fr/assets/files/video/matisse_small.flv&image=http://www.lyc-matisse-trappes.ac-versailles.fr/assets/images/autres/video.jpg&skin=/upload/simple.swf&controlbar=over&fullscreen=true&stretching=fill&autostart=false&screencolor=003333&lightcolor=ffff00&frontcolor=fffff&backcolor=006d89" name="flashvars" />
                </OBJECT>
                </DIV> 
                
                  Schtroumpf Grognon - Grouchy Smurf
                  ---------------------------------
                  Faites pas attention.. - Don&#39;t pay attention
                  http://www.dzi-neo.net