function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RAHXRAHX 

How to Preview a youtube video in visualforce page without saving it in database

Hi,
I am new to salesforce coding and i am having a requirement:
I have one text field on my visualforce page where a user will put youtube URL and there is a preview button on click of which he should be able to see the preview of the video on the same page without saving it to database.After he is done with preview there is a save button on click of which he should be able to save it(by save i mean save the Youtube URL) to  some object.I explored and came to know salesforce provide preview feature only for the file attached through feeder which gets stored in content document object but since my video size can be large in size I dont want to go by that way of previewing a video.Can some one please suggest any solution or code examples to do this.Thanks In advance.
kcpluspluskcplusplus
If I understand correctly what you are looking for, a portal essentially to view a video without storing it, I would recommend using a visualforce page with an iframe to that video url. http://help.salesforce.com/apex/HTViewSolution?id=000176669&language=en_US

--KC
RAHXRAHX
Hi KC,
I am  using iframe tag to embed the video but i am stuck with how to fetch the url from that field on click of preview button without saving it to database and then another problem is when the url is of some other video hosting site rather than from youtube then i have to check in my class if the url is from youtube or some other video hosting site and for that i have to take the url which is entered by user to classify between the url and then display preview.Can you suggest how can we take the field values which are entered on click of preview button before saving.