7

I am using Media Framework 2.0 with Sitecore 8.0. I have been able to generate a flash player with the Media Framework API. This is the code -

args.MarkupType = Sitecore.MediaFramework.Pipelines.MediaGenerateMarkup.MarkupType.Frame;
                    Sitecore.MediaFramework.Brightcove.Players.BrightcovePlayerMarkupGenerator generator = new Sitecore.MediaFramework.Brightcove.Players.BrightcovePlayerMarkupGenerator();
                    Sitecore.MediaFramework.Pipelines.MediaGenerateMarkup.MediaGenerateMarkupPipeline.Run(args);
                    return args.Result.Html;

But I'm not able to generate the HTML5 player using this code. This only works for Flash based players but not HTML5.

Is there a way in the MediaFramework API to accomplish this or will I have to roll my own code to do that?

5

There is a brightcove patch configuration file:

Sitecore.MediaFramework.Services.Brightcove.config

Review current configuration for <playerMarkupGenerators> You will find:

<playerMarkupGenerators>
    <add name="brightcove_video" templateId="{6A5C6835-6E11-4602-A11D-B626E9255397}" type="Sitecore.MediaFramework.Brightcove.Players.BrightcovePlayerMarkupGenerator,Sitecore.MediaFramework.Brightcove">
      <analyticsScriptUrl>/sitecore modules/Web/MediaFramework/js/Analytics/brightcove.js</analyticsScriptUrl>
      <scriptUrl>http://admin.brightcove.com/js/BrightcoveExperiences.js</scriptUrl>
      <parameters hint="raw:AddParameter">
        <param name="isVid" value="true"/>
        <param name="isUI" value="true"/>
        <param name="dynamicStreaming" value="true"/>
        <param name="includeAPI" value="true"/>
        <param name="htmlFallback" value="true"/>
        <param name="templateReadyHandler" value="brightcoveListener.onTemplateReady"/>
      </parameters>
    </add>
    <add name="brightcove_playlist" templateId="{0E24292F-D7A5-4BA2-BCA0-CD5F14A89634}" type="Sitecore.MediaFramework.Brightcove.Players.BrightcovePlayerMarkupGenerator,Sitecore.MediaFramework.Brightcove">
      <analyticsScriptUrl>/sitecore modules/Web/MediaFramework/js/Analytics/brightcove.js</analyticsScriptUrl>
      <scriptUrl>http://admin.brightcove.com/js/BrightcoveExperiences.js</scriptUrl>
      <parameters hint="raw:AddParameter">
        <param name="isVid" value="true"/>
        <param name="isUI" value="true"/>
        <param name="dynamicStreaming" value="true"/>
        <param name="includeAPI" value="true"/>
        <param name="htmlFallback" value="true"/>
        <param name="templateReadyHandler" value="brightcoveListener.onTemplateReady"/>
      </parameters>
    </add>
  </playerMarkupGenerators>

As you can see you can change/remove/add some parameters to generate markup. Try to play with some parameters. As I found here https://stackoverflow.com/questions/8229621/html5-video-with-brightcove you just need to add

<param name="forceHTML" value="true" />

I had not chance to test it. Sorry. Maybe you also need to remove/update some default parameters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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