Click here to Skip to main content
Licence CPOL
First Posted 26 Apr 2008
Views 57,579
Downloads 403
Bookmarked 52 times

Flash Movie Field for WSS 3.0

By | 25 May 2009 | Article
Custom Flash Movie Field for WSS 3.0 to render Flash movies

Figure 1

Figure 1

Figure 2

Figure 2

Introduction

Flash Movie Field is a custom WSS field to render Flash movies and YouTube videos. It uses the excellent swfobject to render the HTML and JavaScript for maximum browser compatibility. In edit mode, authors specify the Url, Width, and Height of the Flash movie. Optional parameters can be added easily by modifying the attached source code.

Description

The Flash Movie Field is based on a new Field Type SPFieldFlashMovie. It has the following properties or column values:

  • Url - URL to Flash (.swf) movie or YouTube video, e.g. /media/map.swf, http://www.youtube.com/v/dMH0bHeiRNg&hl=en&fs=1.
  • Width - Width of Flash movie or YouTube video in pixels. For YouTube video, width includes embedded player.
  • Height - Height of Flash movie or YouTube video in pixels. For YouTube video, height includes embedded player.

Rendering is provided by a custom Field Control FlashMovieField with an associating Rendering Template QuestechFlashMovieFieldTemplate. All UI strings are localized and stored in resource files.

  • \SharePoint\ClientScripts\swfobject.js
    Support JavaScript file for swfobject. Set as Embedded Resource.
  • \SharePoint\Fields\SPFieldFlashMovie.cs
    Field Type for custom Flash Movie field. Inherits from SPFieldMultiColumn.
  • \SharePoint\Fields\SPFieldFlashMovieValue.cs
    A class of column values for SPFieldFlashMovie. Inherits from SPFieldMultiColumnValue.
  • \SharePoint\Resources\Resources.resx
    Project resource file for localized UI strings.
  • \SharePoint\RootFiles\CONFIG\Resources\QuestechCoreFlashMovie.resx
    WSS provisioning resource file and application run-time resource file for localized UI strings. This sets the display name for the custom field and the label strings for properties Url, Width, and Height during authoring. Deploys to ..\12\Resources\.
  • \SharePoint\RootFiles\TEMPLATE\CONTROLTEMPLATES\
    QuestechFlashMovieFieldTemplate.ascx

    Form edit view of FlashMovieField with RenderingTemplate control.
  • \SharePoint\RootFiles\TEMPLATE\XML\fldtypes_SPFieldFlashMovie.xml
    Field Type Definition for Field Type SPFieldFlashMovie.
  • \SharePoint\WebControls\FlashMovieField.cs
    Field Control for SPFieldFlashMovie. Uses swfobject 2.1 to render Flash movies and YouTube videos.
  • \SharePoint\Utility.cs
    Utility file for common methods and properties.

Feature QuestechFlashMovieColumns is required for the deployment. It is responsible for deploying the custom Field Type Definition in fldtypes_SPFieldFlashMovie.xml.

The sample Visual Studio 2008 solution includes all the support files you need to build and deploy the custom field, minus strong name key files (*.snk). It contains three projects: Deployment, Features, and SharePoint. The SharePoint project contains source code for the custom field. The Features project contains features to support the deployment. The Deployment project contains a pre-build script to aggregate all the files needed for deployment. It contains a Solution directory where a WSP file is generated and deployed by a post-build script.

This structure of Visual Studio solution and projects is designed to be scalable to full blown MOSS/WSS development and deployment. You could add additional projects like SharePoint.Publishing for MOSS Publishing development. Within your SharePoint or SharePoint.Publishing projects, you could have custom components like user controls, web controls, web parts, etc.

Installation

To deploy the custom field, follow the procedures below:

  1. Using stsadm, install solution file QuestechFlashMovie.wsp in \Deployments\Solution\
    stsadm -o addsolution -filename QuestechFlashMovie.wsp
  2. Open SharePoint 3.0 Central Administration, go to Operations/Global Configuration/Solution Management. Deploy QuestechFlashMovie.wsp to select web application(s).
  3. Go to the top site in the selected web application(s). Activate Site Collection feature Questech Systems Flash Movie Columns.

The custom Flash Movie Field should now be ready for use. You can go to the Site Columns gallery to verify. To use the custom field in your MOSS page layout, you would first need to add the custom site column to a content type by going to the Site content types gallery. In the gallery listing, select a content type and click Add from existing site columns.

In your page layout ASPX file, modify the code as follows:

...
<%@ Register Tagprefix="QuestechWebControls" 
    Namespace="QuestechSystems.SharePoint.WebControls"
    Assembly="QuestechSystems.SharePoint.FlashMovie, Version=1.0.0.0, 
    Culture=neutral, PublicKeyToken=f268fd4f0f42524c" %>

...
...
<QuestechWebControls:FlashMovieField FieldName="FlashMovieFile" runat="server" />
...

References

  1. Create custom field type in WSS V3 - Jim Yang
  2. SharePoint Resources, Types, Use and Deployment - Mikhail Dikov
  3. swfobject
  4. Features for SharePoint - MSDN Magazine
  5. SharePoint 2007 Features - Creating Site Columns and Content types - Share This Point
  6. Solution Deployment with SharePoint 2007 - MSDN Magazine

History

  • V1.2 - 2009.05.22
    • Converted Visual Studio solution projects to version 2008
    • New SharePoint Solution QuestechFlashMovie.wsp and assembly QuestechSystems.SharePoint.FlashMovie.dll. This allows my other sample solutions in CodeProject to co-exist with this custom field.
    • Renamed feature from QuestechColumns to QuestechFlashMovieColumns
    • Removed feature QuestechAppGlobalResources
  • V1.1 - 2008.08.12
    • Added support of YouTube videos
    • Modified form view layout
    • Upgraded swfobject to V2.1
  • V1.0 - 2008.04.26 - Base

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Stephen Huen

Web Developer
Questech Systems
Canada Canada

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionFlash Movie Field for WSS 3.0 not visible PinmemberStan_Stevens12:38 28 Feb '12  
GeneralError: The given key was not present in the dictionary. PinmemberJingmei Li9:14 8 Feb '09  
GeneralError when select the Flash Movie Filed button in WSS 3.0 Pinmemberoconnortj3:12 18 Sep '08  
GeneralRe: Error when select the Flash Movie Filed button in WSS 3.0 PinmemberStephen Huen18:33 20 Sep '08  
QuestionModify what? Pinmemberroryschmitz6:37 15 Jul '08  
AnswerRe: Modify what? PinmemberStephen Huen11:12 16 Jul '08  
GeneralRe: Modify what? PinmemberCurtisG6:16 19 Aug '08  
GeneralRe: Modify what? PinmemberStephen Huen8:35 27 Aug '08  
QuestionIt couldn't open in vs2005 Pinmembervinoinfozone18:47 18 Jun '08  
AnswerRe: It couldn't open in vs2005 PinmemberStephen Huen14:18 23 Jun '08  
GeneralRe: It couldn't open in vs2005 Pinmember Xmen 18:28 6 Dec '08  
GeneralRe: It couldn't open in vs2005 PinmemberStephen Huen17:00 4 Jan '09  
GeneralFile not found error message PinmemberCheGueVerra12:21 6 Jun '08  
QuestionCould I get some more details... PinmemberCurtisG10:15 4 Jun '08  
GeneralDo I have to use MOSS Pinmembervincemus5:57 4 May '08  
Hi There, thanks for a great article.
I wish to avoid having to use MOSS because of the massive MS Licencing costs. Do I have to use MOSS in order for this to work on my Sharepoint servers in my company?
 
Thanks
Rob
GeneralRe: Do I have to use MOSS PinmemberStephen Huen6:13 4 May '08  
GeneralRe: Do I have to use MOSS Pinmembervincemus6:42 4 May '08  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120529.1 | Last Updated 25 May 2009
Article Copyright 2008 by Stephen Huen
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid