How to play Brightcove Video

Hi

Telligent supports a number of video providers like YouTube, Daily Motion, Vimeo but Not Brightcove.
how to play video through brightcove URL
could you please tell me how to implement it.
--
Thanks & Regards,
Parimal
  • Hi Parimal

    We are in the process of creating several new plugins for the 8.0 platform we may well add this to a project we are working on at the moment. Please contact us and keep an eye on our blog http://www.4-roads.com

    Cheers,

    Rob

  • Which version are you running?  

    If you are on 7.5 or higher, you will probably need to create a plugin that implements the IFileViewer interface:

    http://telligent.com/community/developers/w/developer75/33705.ifileviewer-plugin-type.aspx

    If you are on 7.x (below 7.5, I believe the plugin interface is similar (if not exactly the same), but here's the documentation for it)
    http://telligent.com/community/developers/w/developer7/28484.ifileviewer-plugin-type.aspx 

    6.1 or earlier this is done in the communityserver_override.config and a custom class that inherits from WebVideoFileViewer (earlier versions I believe have different class names, but this is what we used in 6.1).  Hopefully the 6.1 code below could help you properly implement the interface if you're running on 7.x - most of the logic should be the same, it's just a plugin now instead of an override.

    Here is what you could do to add a new YouTube player in 6.1 (for example):

      <Override xpath="/CommunityServer/FileViewers" mode="add" where="start" >
        <add type="MyNamespace.FileViewers.SecureYoutubeViewer, MyDllName" urlPattern="https://(?:www\.)?youtube\.com"  />
      </Override>

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Web;
    using Telligent.Evolution.Components;
    
    namespace MyNamespace.FileViewers
    {
        public class SecureYoutubeViewer : WebVideoFileViewer
        {
            public override string GetPreviewImageUrl(Uri url)
            {
                Match match = CSRegex.YouTubeFileViewerRegex().Match(url.OriginalString);
                if (match.Success)
                {
                    return String.Format("https://img.youtube.com/vi/{0}/default.jpg", Globals.EnsureHtmlEncoded(match.Groups[1].Value));
                }
                else
                {
                    return "~/utility/images/youtube.gif";
                }
            }
    
            public override string GetRenderedViewer(Uri url, int width, int height)
            {
                Match match = CSRegex.YouTubeFileViewerRegex().Match(url.OriginalString);
                if (match.Success)
                {
                    if (width <= 0 || height <= 0)
                    {
                        width = 560;
                        height = 315;
                    }
    
                    // removed wrapping <object /> tag suggested by YouTube to correct rendering in IE6.
                    string ui = string.Format("<iframe width=\"{1}\" height=\"{2}\" src=\"https://www.youtube.com/embed/{0}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>", Globals.EnsureHtmlEncoded(match.Groups[1].Value), width, height);
                    return ui;
                }
                else
                    return string.Empty;
            }
    
            public override string GetPreviewImageUrl()
            {
                return "~/utility/images/youtube.gif";
            }
        }
    }
    
  • In reply to Luke D:

    Hi Luke D

           I have using telligent version 7.5 and follow the suggestion by this url : "telligent.com/.../33705.ifileviewer-plugin-type.aspx" but i don't know how to set this interface on which page. could you please give me detail for implement it.

    thanks.

  • In reply to Parimal:

    You need to write the code, compile the DLL, and then you can use a shortcode in your blog or forum posts like this: [View:www.youtube.com/watch]

    The plugin will detect it and be invoked to replace that with the proper embed code you wrote.

  • In reply to Luke D:

    Hi Luke D,

    *

             I follow the Process Here : 1. Create a classLibrary project.  implement 'IFileViewer' interface as per url you given and compile project and Put this .Dll into refrence folder.  Is it Correct way?

    *

               I have  Add .Dll in Reference folder. but still not play brightcove video. we have a url like this: "link.brightcove.com/.../bcpid2041213080001

    You tube video play well.

    could you please, tell me where i need to do the change ?

    Thanks

  • In reply to Parimal:

    Did you create your own Regex to match the brightcove URL Pattern?

  • In reply to Luke D:

    No i do not make any Regex .

  • In reply to Parimal:

    That would be the missing piece.  

    I typically use this site when creating a regex:  http://regexpal.com/

    It doesn't create it for you, but helps you see in real-time if it is correct and matches the patterns you want it to match.

  • In reply to Luke D:

    i did not get properly. how do i change. can you provide me steps how to real time implement it.

  • In reply to Parimal:

    You need to change this line to your regex to match the URL pattern of the different video provider:

    Match match = CSRegex.YouTubeFileViewerRegex().Match(url.OriginalString);

    You'll then update this to use the proper embed code for this video provider

                    // removed wrapping <object /> tag suggested by YouTube to correct rendering in IE6.
                    string ui = string.Format("<iframe width=\"{1}\" height=\"{2}\" src=\"https://www.youtube.com/embed/{0}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>", Globals.EnsureHtmlEncoded(match.Groups[1].Value), width, height);
                    return ui;
    
  • In reply to Luke D:

    From which place i put this line ?

  • In reply to Luke D:

    It's always funny when you have to master Regex when you want to watch a video.. Okay, here's the solution. It's easy as 1-2-3.

    Please ask Robert Nash for details or just support@4-roads.com

  • In reply to Rouslan Grabar:

    As you can see, the video link http://bcove.me/pu5xut7w was replaced automagicaly when I pasted it into the editor. You can also share the player link, like link.brightcove.com/.../bcpid1039236672001

  • In reply to Rouslan Grabar:

    Just to clarify though - this is not free.. correct

Related