Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Embedding/inserting flv files / using insert flash object

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 6190 Views
  • africansafari
    Avatar
    Community Member
    30 Posts

    Embedding/inserting flv files / using insert flash object Link to this post

    Hi folks,

    I have looked through various threads to find out how to embed/install a .flv file on website.

    I have uploaded and can't see .flv via 'insert flash object' .... so thought I would embed using the following html .... I have adjusted domain name, video name etc

    <div id="v1234">
    <a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this video.
    </div>
    <script type="text/javascript" src="https://media.hosting.com/mp4/swfobject.js"></script>
    <script type="text/javascript">
    var swf = new SWFObject("https://media.hosting.com/mp4/player.swf", "mpl", "720", "596", 8); swf.addParam("allowfullscreen", "true"); swf.addParam("allowscriptaccess", "always"); swf.addVariable("file", "http://www.mydomain.com/videos/video.flv");
    swf.addVariable("image", "http://www.mydomain.com/videos/video.jpeg");
    swf.write("v1234");
    </script>

    However .... no .flv file plays.

    I just can't seem to work it out??? This should be easy, right?

    Maybe I am missing a very basic step?

    Any assistance would be great!

    Claire

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Re: Embedding/inserting flv files / using insert flash object Link to this post

    Hi Claire

    Where are you putting this code? In a template or in the CMS editor?

    Can you see the correct source code when you view source on your front end page?

    Aaron

  • africansafari
    Avatar
    Community Member
    30 Posts

    Re: Embedding/inserting flv files / using insert flash object Link to this post

    Thanks for the quick reply Arran. I am placing code in the "edit html content" within the content editor.

    When I save, view and then return to html content .... it seems to have disappeared.

    Does that give any more clues?

    Cheers

    Claire

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Re: Embedding/inserting flv files / using insert flash object Link to this post

    Yup,

    You can't do that. Not by default anyway. TinyMCE (the editor) is setup to strip certain tags for securtiy reasons.

    You can amend this yourself, but you will need to get into the core files to change the the way Tiny is setup.

    More details can be found here. This person is not installing flash, but the same issue with the same work around is there.

    http://www.silverstripe.org/general-questions/show/274442?start=0#post274530#post274530

    Aaron

  • africansafari
    Avatar
    Community Member
    30 Posts

    Re: Embedding/inserting flv files / using insert flash object Link to this post

    Thanks Aaron. Looks more complicated that I want

    How come it is possible to imbed youtube and other hosted videos using HTML in TinyMCE?

    Cheers

    Claire

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Re: Embedding/inserting flv files / using insert flash object Link to this post

    Hi Claire,

    Because Youtube doesn't use javascript in their embed code like you have posted. They use the object tag.

    Try paste yours in the CMS again, then re-open the html window. You will notice that the <div> and everything in between is still there, but everything in the script tags (and the script tags themselves) has been stripped out by TinyMCE.

    Object tags aren't that bad security-wise. Javascript on the other hand can be nasty in the wrong hands.

    You could of course put your flv into traditional object tags the way Youtube does. Here is an example embed:

    <object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/-YqpTirruKY&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/-YqpTirruKY&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>

    Aaron

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Embedding/inserting flv files / using insert flash object Link to this post

    Hi

    Embedding content like this just calls for problems. JavaScript doesn't belong in the content area at all. It should be applied as an unobtrusive "layer" on top of your content. Embedding flash like Aaron proposed might work, but is really cumbersome and error prone.
    There are multiple solutions to this though. If the embeddable content really needs to be inside the content-text, I'd probably use some sort of placeholder variable and replace it with the correct embed code during parsing. This recipe could be a good starting point:
    http://doc.silverstripe.org/doku.php?id=recipes:customising-content-in-your-templates

    If you're not uncomfortable writing some regex for parsing, you could even do something like $YouTube(oHg5SJYRHA0), which would then be parsed and correctly embed the video at: http://www.youtube.com/watch?v=oHg5SJYRHA0

    The things get a whole lot easier if you separate your movie from the text content though. A really simple approach would be to add an additional TextArea field to add embed codes in plain text. Or something like described here: http://silverstripe.org/general-questions/show/273828?start=0#post274276
    The solution provided in this thread could easily be extended to allow for a video (flv) and image upload (as starting image in the player and as alternative content).

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Re: Embedding/inserting flv files / using insert flash object Link to this post

    Banal's suggestion is exactly how I would do it and do. The question of allowing advanced HTML into Tiny comes up alot on on these forums (three times in the last week) and generally the people wanting to do so have reasons of their own, or are not advanced enough to quickly get what they need in a timeframe that may be urgent, and in a scalable way. So this work-around is provided and always has been (Not just for this CMS).

    Banal's suggestion is by far the safest and more structured approach for anything like this. If you are willing to get into coding for Silverstripe (which will only help you), then I suggest you heed his advice and links he provided.

    Aaron

    6190 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.