How to upload videos into custom object record like as photo upload in rich text field. no need to display a link i want to display a video


Salesforce doesn't really shine as a streaming video provider ;) so the best route for an admin is to integrate with a third party service like Youtube. They handle encoding, hosting, and the video player:

  1. create a YouTubeId__c text field on your custom object to hold the youtube ?v= id,

  2. write a WidgetVideoPlayer Visualforce Page which embeds the content, for example:

    <apex:page standardController="Widget__c" showHeader="false">
      <apex:iframe height="240" src="https://www.youtube.com/v/{!Widget__c.YouTubeId__c}" />

Then you can edit the Page Layout for your Custom Object and place your Visualforce Page in a section alongside the other fields.

embedded video player

It will be taxing to get this functionality embedded in a rich text field. If you did store the videos on platform, you could write a shortcode parser and use JWPlayer to attempt to tighten the integration.

  • hi user320 what datatype YouTubeId__c and what id to store YouTubeId__c field. – nagarjuna Dec 17 '13 at 10:44
  • 2
    @user320 nice video must check that out! ;-) – Andrew Fawcett Dec 17 '13 at 11:53
  • thanks user320. its working fine. can i store this video in salesforce. no need to call external youtube website – nagarjuna Dec 17 '13 at 12:32
  • 1
    Not easily, @user4812. How much time+resource do you have? Big videos could be uploaded as Chatter Files. It will live at /sfc/servlet.shepherd/version/download/068_version_id_here which you might be able to feed to JWPlayer but I don't recommend it. – Matt and Neil Dec 17 '13 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.