1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How to use the Viddler video provider

How to use the Viddler video provider

20 posts, 0 answered
  1. Schneider
    Schneider avatar
    29 posts
    Registered:
    02 Nov 2008
    06 Feb 2009
    Link to this post
    We would like to use video on our website and we notice there is a ViddlerProvider inside the Telerik.Libraries assembly.

    How do we setup and use this provider?

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    06 Feb 2009
    Link to this post
    Hello Schneider,

    You should add the following line to your web.config file under <cmsEnginedefaultProvider="Generic_Content"><providers>

     <add name="Viddler" urlRewriteFormat="~/{LibraryName}/[Name].sflb.ashx" thumbnailExtension=".tmb" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/Libraries" allowVersioning="True" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.ViddlerProvider, Telerik.Libraries.Data" tagEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Libraries/BatchTagsEditor.ascx"/> 

    Then you should add a new section for media provider as below:

    <mediaProvider defaultProvider="viddler"
          <providers> 
            <add name="viddler" type="Telerik.Libraries.MediaProvider.ViddlerProvider" apiKey="YOUR KEY HERE" baseUrl="http://api.viddler.com/rest/v1/" username="YOUR USERNAME HERE" 
                 password="YOUR PASSWORD HERE" /> 
          </providers> 
        </mediaProvider> 

    Finally, you should add the following control in <toolboxControls> section

    <add name="Viddler Videos" section="VIDDLER" type="Telerik.Libraries.WebControls.ViddlerVideo, Telerik.Libraries" 
    description="Viddler video content control" /> 

    I hope this helps.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Schneider
    Schneider avatar
    29 posts
    Registered:
    02 Nov 2008
    09 Feb 2009
    Link to this post
    Thanks.

    Are there any other video providers in the pipeline? e.g. for YouTube, Vimeo etc
  4. Schneider
    Schneider avatar
    29 posts
    Registered:
    02 Nov 2008
    09 Feb 2009
    Link to this post
    Erm, OK.

    So now how do I get videos to show up? Currently it appears that the Viddler Videos control displays a list of recent items from our Library module! How are these supposed to get turned into Viddler videos?

    Is there a blog article about getting this to work? If not it would be useful.

    Thanks,
    Jack
  5. Schneider
    Schneider avatar
    29 posts
    Registered:
    02 Nov 2008
    09 Feb 2009
    Link to this post
    Ok I have discovered one more step on my own.

    I need to add this to the web.config:

            <add name="Viddler" title="Viddle Video Library" defaultExtenstions=".*" metaKeys="Author, Description, Extension, Name, Size, Category"
            </add> 

    to the libraries/libraryInfo section.

    That then asks me to enter a username/password when I create a new Viddler gallery.

    The problem is it then asks me to upload videos (how is this meant to work -does it forward them into Viddler).

    There is also a button called Sync Video on the left. When I click that it crashes with the following error:

     Configuration Error 
    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 
     
    Parser Error Message: Unrecognized attribute 'username'. Note that attribute names are case-sensitive. 
     
    Source Error: 
     
    Line 478:    <mediaProvider defaultProvider="viddler"
    Line 479:      <providers> 
    Line 480:        <add name="viddler" type="Telerik.Libraries.MediaProvider.ViddlerProvider" apiKey="YOUR KEY HERE" baseUrl="http://api.viddler.com/rest/v1/" username="YOUR USERNAME HERE" password="YOUR PASSWORD HERE" /> 
    Line 481:      </providers> 
    Line 482:    </mediaProvider> 

    Fair enough, I have not entered my username/password yet - but its saying the username attribute is unrecognised!

    The mystery deepens. Thank god for reflector...
  6. Schneider
    Schneider avatar
    29 posts
    Registered:
    02 Nov 2008
    09 Feb 2009
    Link to this post
    I am getting the following error when I try to upload a video:

    Server Error in '/' Application. 
    Unable to cast object of type 'System.Byte[]' to type 'System.String'. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
     
    Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Byte[]' to type 'System.String'. 
     
    Source Error: 
     
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
     
    Stack Trace: 
     
    [InvalidCastException: Unable to cast object of type 'System.Byte[]' to type 'System.String'.] 
       Telerik.Libraries.WebControls.Admin.ControlPanel.CreateItemEditView() +504 
       Telerik.Libraries.WebControls.Admin.ControlPanel.CreateChildControls() +1088 
       System.Web.UI.Control.EnsureChildControls() +87 
       System.Web.UI.WebControls.CompositeControl.RecreateChildControls() +24 
       Telerik.Cms.Engine.WebControls.Admin.ControlPanel.set_Mode(Modes value) +854 
       Telerik.Libraries.WebControls.Admin.ControlPanel.set_DisplayMode(DisplayMode value) +135 
       Telerik.Libraries.WebControls.Admin.ControlPanel.uploader_UploadFinished(Object sender, LibrarySelectedEventArgs e) +103 
       Telerik.Libraries.WebControls.Admin.ItemUploader.OnUploadFinished(LibrarySelectedEventArgs e2) +607 
       Telerik.Libraries.WebControls.Admin.ItemUploader.UploadFiles(ILibrary library) +6708 
       Telerik.Libraries.WebControls.Admin.ItemUploader.Button_Command(Object sender, CommandEventArgs e) +173 
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +108 
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135 
       System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175 
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 
     

  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    09 Feb 2009
    Link to this post
    Hi Schneider,

    You need to have an account at viddler and api key that you should set in your web.config file. As I see you have copied the lines I sent you last time. The object reference error could be thrown if you do not have api key for synchronization between Sitefinity and Viddler. The API key collects data for your account, so username and password are not required for 3.5 SP1.
    We performed some optimizations in that area for the 3.6 release.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Greg
    Greg avatar
    1 posts
    Registered:
    10 Feb 2009
    10 Feb 2009
    Link to this post
    Hey guys,

    Do you have any specification, documentation and screenshots of how Viddler integrates into SiteFinity?

    We've started looking at integrating a video solution into a site and to save time would like to use a built in solution.

    Thanks
    Greg
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    10 Feb 2009
    Link to this post
    Hi Greg,

    We will have a new section in our UserManual for 3.6 regarding videos and streaming in Sitefinity with Viddler and Amazon S3. Generally, most of the steps are described in this post. You may find the following blog post useful Adding streaming video content to your site, Amazon S3 support in Sitefinity 3.6
    We found some bugs in the current official release and this was the reason not to officially announce and document the implementation of the streaming provides.

    Let us know if there is anything else that we can do for you.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    29 Jun 2009
    Link to this post
    is there a way to use a "video picker" to associate a specific video with a news item?
  11. Nikolai
    Nikolai avatar
    216 posts
    Registered:
    01 Jun 2017
    30 Jun 2009
    Link to this post
    Hello SelArom,

    Here is a suggestion using Sitefinity 3.6:
    1. Create a text custom meta field in the News Module called "URL"
    Now you can take the video url from the video library and copy/paste it to the news item that this video will belong to.
    2. Open ~\Sitefinity\ControlTemplates\News\ListPageDetails.ascx and modify it to look like this:
    <%@ Control Language="C#" %> 
    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls" TagPrefix="sfWeb" %> 
    <%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Web.UI.SpamProtection" TagPrefix="sfWeb" %> 
    <%@ Register assembly="System.Web.Silverlight" namespace="System.Web.UI.SilverlightControls" tagprefix="asp" %> 
     
    <script runat="server">protected void AddVideo(object sender, EventArgs e) 
        if (!string.IsNullOrEmpty(URL.Text)) 
        { 
            this.mplayer.MediaSource = URL.Text; 
        } 
    </script> 
    <telerik:CssFileLink ID="CssFileLink1" EmbeddedFileName="Telerik.News.Resources.ControlTemplates.Frontend.newsCommonLayout.css" FileName="" Media="screen" runat="server" /> 
    <telerik:JsFileLink id="jsLink" runat="server" ScriptType="jQuery" /> 
         
    <div class="sf_singleNews"
        <asp:HyperLink ID="backToList1" Text="<%$Resources:AllNews %>" CssClass="sf_back" runat="server"></asp:HyperLink> 
        <h2 class="sf_NewsTitle"
            <asp:Literal ID="Title" runat="server"></asp:Literal> 
        </h2> 
        <class="sf_newsDate"
            <asp:Literal ID="Publication_Date" runat="server" Text="{0}" /> 
        </p> 
        <p> 
            <asp:Literal ID="Summary" runat="server"></asp:Literal> 
        </p> 
        <p> 
            <asp:Literal ID="content" runat="server"></asp:Literal> 
        </p> 
        <class="sf_newsAuthor"
            <asp:Literal ID="Author" runat="server"></asp:Literal> 
        </p> 
        <p> 
            <asp:Literal ID="Source" runat="server"></asp:Literal> 
        </p> 
        <p> 
            <asp:Literal ID="URL" runat="server" OnLoad="AddVideo" Visible="false"></asp:Literal> 
        </p> 
        <p> 
        <asp:MediaPlayer ID="mplayer" runat="server" Width="500" Height="500"></asp:MediaPlayer> 
        </p> 
        <class="sf_postCategory"
            <asp:HyperLink ID="Category" runat="server" /> 
        </p> 
         
        <asp:Repeater ID="Tags" runat="server"
            <HeaderTemplate><p class="sf_postTags"></HeaderTemplate> 
            <ItemTemplate> 
                <asp:HyperLink ID="tagLink" runat="server" />             
            </ItemTemplate> 
            <FooterTemplate></p></FooterTemplate> 
        </asp:Repeater> 
         
         
        <asp:Repeater ID="Bookmarks" runat="server"
            <HeaderTemplate><p class="sf_postBookmark"></HeaderTemplate> 
            <ItemTemplate> 
                <asp:HyperLink ID="BookmarkLink" runat="server"
                    <asp:Image ID="BookmarkImage" runat="server" /> 
                </asp:HyperLink> 
            </ItemTemplate> 
            <FooterTemplate></p></FooterTemplate> 
        </asp:Repeater> 
         
        <div id="comments" class="sf_contentComments"
            <sfWeb:CommentsList id="commentsList" runat="server" cssclass="sf_commentsList" ValidationGroup="commentInfo"></sfWeb:CommentsList> 
        </div> 
    </div> 
     

    This way the MS Media Player control will play the video from the library(see the attachment).
    In order to create a video picker all you have to do is to create a content selector for the URL meta field in the Admin section.

    Hope this helps.

    Greetings,
    Nikolai
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  12. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    30 Jun 2009
    Link to this post
    linking to the video would probably be simple enough, but I was hoping for a way to embed a video into the news details page, can this be done?

    addiitionally, I'm looking to use the viddler player, because these videos are in flash which I don't think will play in windows media player...

    EDIT: Hey! I just realized I can edit my posts! finally! kudos sf team :)

    back to topic, I would be okay with linking to the video on a separate page, but I still want to be able to associate the video with the news item, so that on the video I can have it link back to the related news story. what would be the best approach?

    I need the news story to link to the video, and the video to link back to the news story...
  13. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    01 Jul 2009
    Link to this post
    whew i tried to make sense of the api for viddler and libraries but it's pretty complex...

    I figure what I could do is store the library ID for the individual video into the news story. This way I can build the link to the video item by retrieving the associated ID.

    this will also let me link back, since I can just do a search for news items that match the video id...

    but I can't seem to find a way to do this correctly can anyone from sf (or anyone who may have done something similar here) help out?

    many thanks!
  14. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    01 Jul 2009
    Link to this post
    I was able to make some headway on this. I'm about to leave for the weekend so I don't have time to go into to much detail (I'll probably make a blog post on this soon) but in case any one needs it here's some of the code I used to get it to work:

            var libmgr = new LibraryManager("Video");  
            var content = libmgr.GetContent(new Guid("c37a6e7d-28dc-4bf6-9100-5a3fc5e79200"));  
            var vid = XmlToObject<VideoElement>.Deserialize((string)content.Content);  
            lnkVideo.NavigateUrl = "/video/default" + content.Url.Substring(1) + ".aspx";  
            VidThumb.ImageUrl = vid.ThumbUrl;  
            VidThumb.Width = 300; 

    here I hard coded the GUID so I could test it but you could easily retrieve this from the content MetaData of the news item. the VideoElement is the class you want to use to populate any links, titles, etc, or even to embed the video directly on the page!

    more later, happy 4th of july!
  15. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    21 Jul 2009
    Link to this post
    SelArom - 

    Do you think you could post some more detail on this technique. I think this would be beneficial for the community.

    Thanks.

    bnye
  16. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    23 Jul 2009
    Link to this post
    hah i totally forgot about this! I'll try and find time to put together a post tomorrow, thanks for the reminder!
  17. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    23 Jul 2009
    Link to this post
    argh! I wrote the article but apparently my sitefinity upgrade didn't complete on my software blog... so now I have to wait until I get home :(

    i'll post this later tonight!
  18. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    29 Jul 2009
    Link to this post
    well I FINALLY got my site working and posted my blog entry on this. Please visit below, hope someone finds this helpful!

    http://www.selarom.net/blog/2009-07-29/Sitefinity_Linking_Viddler_Videos_and_News_Articles.aspx

  19. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    06 Nov 2009
    Link to this post
    quick question on this: is there any danger or issues with having two separate sitefinity websites link and synchronize to the same viddler account?
     
    Our city has a viddler account, which we've synched to our homepage, but we have other department websites who could make use of it. However, I would prefer to keep all the videos under the city viddler account so that they can all be linked together. Will linking multiple sites to the same viddler account cause any data issues in either sitefinity or viddler?

    thanks!
  20. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    09 Nov 2009
    Link to this post
    Hello SelArom,

    The viddler is used for storage and Sitefinity is only acceptor of the data. The only problem you may have could be result of deleting some items from the viddler storage.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
20 posts, 0 answered