Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I created a custom display form for a list. This list have a media field column. And in my custom display form I want to be able to play a video that I have uploaded to this list.

When I upload a video to this media field column, the video is uploaded to an Asset Library. And when I open the list item with my custom edit form, it only shows the url of the video.

When I open the item with the default display form, the video player appears normally, but in my custom form it only shows the url.

The default display form uses ListFormWebPart to display items. But custom display form uses an xsl template.

Here is what it looks like;

<xsl:template name="dvt_1.rowview">
        <tr>
            <td>
                <table border="0" cellspacing="0" width="100%">
                    <tr>
                        <td width="500px" valign="top" class="ms-formbody">
                            <xsl:value-of select="@Video"/>
                        </td>
                    </tr>
                    <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
                        <tr>
                            <td colspan="99" class="ms-vb">
                                <span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
                            </td>
                        </tr>
                    </xsl:if>
                </table>
            </td>
        </tr>
    </xsl:template>

This code only show the url of the video. Do you have any idea how to play video on custom display forms?

share|improve this question
add comment

4 Answers

Why don't you add a Content editor web part on dispform.aspx and try adding the video play (code) there instead?

You can always add a Web Part to the list forms.

share|improve this answer
    
I tried, but the problem is; I have other columns than the Video column. the page is loaded with querystring which brings the id of the list item. Everytime it is a different item, so the video will change when the item is changed. Does content editor support this somehow? –  yur Jan 18 '12 at 13:08
    
Yes, you can use jQuery Script or Javascript to pass the parameters to the video as well. look at this sample example geekswithblogs.net/SoYouKnow/archive/2011/04/06/… –  Falak Mahmood Jan 18 '12 at 13:55
add comment

Free Styler's option would work, the only hang up might be that your video URL is stored in the item's data, and you can't connect a CEWP to a display form to extract the data.

You could use your XSL in your display form to write the embed code for a player like Flowplayer (http://flowplayer.org/) and pass the URL in from the data.

share|improve this answer
add comment

this might help:

http://www.wssdemo.com/Blog/archive/tags/Data%20View/default.aspx

but I would do it like 'Free Styler' with a content web part.

share|improve this answer
add comment

You should be able to take your custom display form edit it in SPD and create a webpartzone for the area you would like to play the video in. Open the page in SharePoint and then add the media element webpart use the initialization parameter to give it the address of your video on load.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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