22847 Posts in 9589 Topics by 2802 members
General questions about getting started with SilverStripe that don't fit in any of the categories above.
|Go to End|
2 December 2009 at 9:24am
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
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this video.
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");
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!
2 December 2009 at 2:28pm
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?
2 December 2009 at 3:10pm
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?
2 December 2009 at 3:21pm
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.
2 December 2009 at 4:17pm
Thanks Aaron. Looks more complicated that I want
How come it is possible to imbed youtube and other hosted videos using HTML in TinyMCE?
2 December 2009 at 4:52pm Last edited: 2 December 2009 4:54pm
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.
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>
2 December 2009 at 9:01pm
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:
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).
2 December 2009 at 9:16pm
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.
|Go to Top|