I need to let users embed videos, images, audio files, etc. inside text. For right now, these videos will come from urls, but they might one day point to videos/images/audio files stored on the server too.
The text they are writing is using a javascript editor that allows them to change the formatting, size, etc.
I am sort of at a loss as to easily let them add images, videos, audio files inside of the text. I'm just not sure the best way to go about it. I can think of a few technical solutions, but I don't even know if they are worth pursuing.
My first thoughts were to create a parser/language for embedding these kinds of things. That way when they give the url to a video or mp3, it would translate that into some javascript to stream the file. The syntax could be something like [video]http://www.somewhere.com/myvideo.flv[/video] - and it would translate this to using jwplayer or something like that.
Is that too complicated? Is there a better way to go about offering this feature?
Letting them put the videos/images/audio clips at the exact position in the text is important. It can't be at the end of the text or anything like that.
They don't need to play the audio/video content in the textarea, but they do need to see that it's been added. I plan on taking these placeholders and translating them to the appropriate html/javascript code so that when this text is viewed elsewhere, they can play the video and listen to the audio.