![]() |
Enterprise Systems »
SharePoint Server »
Custom Controls
Intermediate
License: The Code Project Open License (CPOL)
Flash Movie Field for WSS 3.0By Stephen HuenCustom Flash Movie Field for WSS 3.0 to render Flash movies |
C# (C#1.0, C#2.0, C#3.0), ASP.NET, Visual-Studio (VS2008), Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
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.
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.
SPFieldMultiColumn. SPFieldFlashMovie. Inherits from SPFieldMultiColumnValue. Url, Width, and Height during authoring. Deploys to ..\12\Resources\. FlashMovieField with RenderingTemplate control. SPFieldFlashMovie. SPFieldFlashMovie. Uses swfobject 2.1 to render Flash movies and YouTube videos. 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.
To deploy the custom field, follow the procedures below:
stsadm, install solution file QuestechFlashMovie.wsp in \Deployments\Solution\
stsadm -o addsolution -filename QuestechFlashMovie.wsp
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" />
...
QuestechColumns to QuestechFlashMovieColumns QuestechAppGlobalResources swfobject to V2.1
General
News
Question
Answer
Joke
Rant
Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads.
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 25 May 2009 Editor: Deeksha Shenoy |
Copyright 2008 by Stephen Huen Everything else Copyright © CodeProject, 1999-2010 Web09 | Advertise on the Code Project |