Visualforce retro-compatibility

All functionalities presented so far are available also in Salesforce Classic, specifically through VisualForce components. In this section we will go through a couple of examples on how to implement video recording and browsing capabilities for those of you that are still running Salesforce as the world was used to before Lightning came to life.

Video recording in Salesforce Classic

The Lightning component described in the earlier sections is exposing the same set of functionalities of the underlying VisualForce component, so if you are planning to offer video recording capabilities to your Salesforce Classic user base, you will need just to learn how to map what we have described so far to a VisualForce context.

Let's then introduce the nativevideo:record VisualForce component, that can be dropped in any VisualForce page you are going to build.
Following what has been described in the "Recording and browsing one video per record" section, the equivalent code of the one seen in the paragraph 3 for the Lightning Action - Video Recording Component Controller would be:

<apex:page showHeader="false" sidebar="false" standardController="FAQ__c">
	<nativevideo:record 
		updateObjectName="FAQ__c"
		updateField="Video__c"
		updateRecordID="{!id}"
	/>
</apex:page>

This code will then display the VisualForce equivalent for the VideoRecord Lightning component, allowing you to offer video recording capabilities to your Salesforce audience. The set of parameters and configurations are all the same as described in the previous Salesforce Lightning sections.


Moving now to the second option, where we can link more than a video to the same Salesforce record, as described in the "Recording and browsing multiple videos per record" page, the equivalent snippet of code mentioned in the paragraph 2 in the note Lightning Action - Opportunity Video Recording Component is:

<apex:page showHeader="false" sidebar="false" standardController="Opportunity">
	<nativevideo:record 
		createJunctionWithObject="Opportunity"
		createJunctionParentField="Opportunity__c"
		createJunctionWithParentID="{!id}"
	/>
</apex:page>

And again this code will allow your users to record multiple videos against the Opportunity record they are currently browsing.


Finally, please note that unfortunately in Salesforce Classic there isn't an equivalent Point and Click approach, so the VisualForce components have to be added to an existing or a new VisualForce page - so in other words, you don't have a config-only approach you can leverage, as in Salesforce Lightning.

Video browsing in Salesforce Classic

A very similar approach to what has been just described for the recording capabilities can be followed for the browsing requirements you have in Classic. This time, the VideoList Lightning Component can be mapped by a VisualForce component called nativevideo:list. Let's take a look again at how to map it under both one to one and one to many scenarios.


As described in the "Recording and browsing one video per record" section, the equivalent of the point and click configuration described in paragraph 3 would be a VisualForce page that embeds the NativeVideo browsing component:

<apex:page showHeader="false" sidebar="false" standardController="FAQ__c">
    <nativevideo:list 
        queryObject="FAQ__c"
        queryRecordID="{!id}"
        selectVideoField="Video__c"
        hideFooter="true"
    />
</apex:page>

This VisualForce page will then check the Video__c lookup field on the FAQ__c object and, if populated, it will display a video player with the associated file that has been previously either recorded or uploaded.

Let's take now a look on how to display a list of videos associated to a single Salesforce record, as originally described in section 3 of "Recording and browsing multiple videos per record". As mentioned already, we won't be able to drag and drop any predefined component, but we will have to defined a new VisualForce page that embeds a code similar to the following one:

<apex:page showHeader="false" sidebar="false" standardController="Opportunity">
	<nativevideo:list
		parentObject="Opportunity"
		filterByField="Opportunity__c"
		filterByValue="{!id}"
		hideFooter="true"
	/>
</apex:page>

As you can see, with just few lines of VisualForce code you can render the list of videos associated to a Salesforce record.



Conclusion & Next Steps

In this chapter we have briefly introduced how to map the out of the box Lightning components to Salesforce Classic, offering the same video recording and capabilities within VisualForce. As mentioned, unfortunately there is no equivalent in Salesforce Classic for the Point and Click interface, so few coding is required.

In the next and final section we will go through some of the common technical questions we have heard so far, and please get in touch if you have more.