We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18219
    • 826 Posts
    To insert a video in the code, not always simple.
    So, I created this small snippet for insert the vidéo (only MediaPlayer for a moment).

    Install:
    - To use it, it is enough to create the directory “/assets/snippets/simplevideoshow"
    - Unzip files and to place them in this directory
    - To place videos in the repertory “/assets/media"
    - To create the snippet “SimpleVideoShow” and to place the contents of the file “snippet.simplevideoshow.php”

    To place the code [!SimpleVideoShow? &video=`my_video.wmv` !] in the document.

    Option:
    - $snipPath= [ text ] : path of the folder to install a simplevideoshow snippet. Default: "assets/snippets/simplevideoshow/"
    - $videoPath= [ text ] : path of the folder to install a video. Default: "assets/media/"
    - $video = [ text ] : name of video
    - $width = [ number ] : width of video. Default: "400"
    - $height = [ number ] : height of video. Default: "340"
    - &lang = [ text ] : Language to use [ english | french ] (you can add more by your self, see english.inc.php for example)
    - $showcontrols = [ text ] : parameter showcontrols for the video. Default: "true"
    - $autostart = [ text ] : parameter autostart for the video. Default: "false"
    - $controller = [ text ] : parameter controller for the video. Default: "true"
    - $showstatusbar = [ text ] : parameter showstatusbar for the video. Default: "true"
    - $volume = [ text ] : parameter volume for the video. Default: "75%"
    - $animationatstart = [ text ] : parameter animationatstart for the video. Default: "false"
    - $transparentatstart = [ text ] : parameter transparentatstart for the video. Default: "true"
    - $qtsrcdontusebrowser = [ text ] : parameter qtsrcdontusebrowser for the video. Default: "true"
    - $enablejavascript" = [ text ] : parameter enablejavascript for the video. Default: "true"


    todo:
    - Change code for accept other player

    Last edit :
    Change word ’repertory’ by ’directory’
      Marc
      I'm French... Sorry for my bad English, I use ' Google Translator' or other... but that remains that tools wink
      • 22815
      • 1,097 Posts
      That looks very useful.

      (In case people are scratching their heads at the above, by repertory he means directory/folder.)
        No, I don't know what OpenGeek's saying half the time either.
        MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
        Forum: Where to post threads about add-ons | Forum Rules
        Like MODx? donate (and/or share your resources)
        Like me? See my Amazon wishlist
        MODx "Most Promising CMS" - so appropriate!
        • 18219
        • 826 Posts
        I have post the new version of this snippet in repository.

        I wait all comment.
        Thanks
          Marc
          I'm French... Sorry for my bad English, I use ' Google Translator' or other... but that remains that tools wink
          • 23547
          • 32 Posts
          This is great!

          I’ll test it later tonight. How long do you think it will take you to get Real, Quicktime, and maybe Linux media players support integrated?
            • 23547
            • 32 Posts
            just tried the snippet with the default call and got this error on the page:

            Parse error: syntax error, unexpected ’<’ in /home/vahanafo/public_html/mydomain/manager/includes/document.parser.class.inc.php(705) : eval()’d code on line 1

            Clueless on this one.
            Any ideas why the error?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              That’s from <?php at the beginning, and ?> at the end of the snippet code. The new versions of MODx allow for those, while the 0.9.2.2 version doesn’t like that. Just remove them from the snippet code.

              And often even in the new version, if I’m copy/pasting the code that has these, if I don’t pay attention, I’ll end up with doubles!
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 23547
                • 32 Posts
                @sottwell: The snippet code had <? and ?>, and removing them solved the problem. None of the other snippets that I have copied and pasted had those.

                The player itself worked fine and the controls were perfect: forwarding and rewinding presented no problems.

                A question for the experts. How would I display thumbnail images of several videos on a page so that clicking on any would expand to a desired size?