Embed code Brightcove media api - api

I am trying to find out a way to access the publishing code of a video on my media api through brightcove, just like the one that you can get on there cloud studio for a player like this one below.
<!-- Start of Brightcove Player -->
<div style="display:none">
</div>
<!--
By use of this code snippet, I agree to the Brightcove Publisher T and C
found at https://accounts.brightcove.com/en/terms-and-conditions/.
-->
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperience" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="960" />
<param name="height" value="445" />
<param name="playerID" value="2164048951001" />
<param name="playerKey" value="AQ~~,AAABzJDWv4k~,nrw5-YJoyhvZYIpODobX62cNFZVSM1ri" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
</object>
<!--
This script tag will cause the Brightcove Players defined above it to be created as soon
as the line is read by the browser. If you wish to have the player instantiated only after
the rest of the HTML is processed and the page load is complete, remove the line.
-->
<script type="text/javascript">brightcove.createExperiences();</script>
I would like to make this an option in my video metadata section of my api, does anyone have any suggestions where to start. Thanks.

I'm not sure you can gather the publishing code of an asset via the BC API but it isn't necessary. What you can do is use variables to replace the only items of that snippet which may change - primarily playerID and playerKey and videoPlayer value (which will indicate which player to use and which video to insert) but also potentially width and height settings.
Let's say you are looking to dynamically swap out the video (assuming you will always use the same player), you could do something like this:
function get_player($video_id){
$player = '<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperience" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="960" />
<param name="height" value="445" />
<param name="playerID" value="2164048951001" />
<param name="playerKey" value="AQ~~,AAABzJDWv4k~,nrw5-YJoyhvZYIpODobX62cNFZVSM1ri" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="#videoPlayer" value="'.$video_id.'" />
</object><script type="text/javascript">brightcove.createExperiences();</script>';
return $player;
}
And then just call the function using the id of the video you want to display in this player. The same could be applied for swapping out players and sizes.
echo get_player('my_video_id');
the #videoPlayer param tells the player which video to load.
This documentation may help.

Related

File Upload not working in Struts2-Struts1 Plugin its setting NULL

We are currently migrating our application from struts 1 to struts 2 module wise and we are making use of the struts2-strut1 plugin.
Every things seems to be working fine, expect for file we are getting the file property value as NULL.
We have checked everything see below our tag looks like
JSP code Snippet
<s:form name="uploadForm" namespace="/struts2" action="upload" enctype="multipart/form-data" method="post">
<s:file name="doc" cssClass="genTextValues"/>
<s:submit/>
</s:form>
Java Action form
public class UploadForm extends ActionForm {
private FormFile doc;
public FormFile getDoc() {
return doc;
}
// its not setting gives null in action form
public void setDoc(FormFile doc) {
this.doc = doc;
}
}
Struts.xml mapping
<interceptor name="uploadForm" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor">
<param name="scope">request</param>
<param name="className">com.form.UploadForm</param>
<param name="name">uploadForm</param>
</interceptor>
<interceptor-stack name="iUploadForm">
<interceptor-ref name="staticParams" />
<interceptor-ref name="uploadForm" />
<interceptor-ref name="modelDriven" />
<interceptor-ref name="basicStack" />
</interceptor-stack>
<action name="uploadDoc" class="org.apache.struts2.s1.Struts1Action">
<param name="className">com.test.action.UploadAction</param>
<interceptor-ref name="iUploadForm"/>
<result name="Success" type="tiles">Success</result>
</action>
We have added required jar see below:
commons-fileupload.jar
struts.jar
struts2-struts1-plugin.jar
struts2-core.jar (2.16)
commons-io2.2.jar
other required jars
There is no fileUpload interceptor in your interceptor-stack.
<interceptor-stack name="iUploadForm">
<interceptor-ref name="staticParams" />
<interceptor-ref name="fileUpload"/>
<interceptor-ref name="uploadForm" />
<interceptor-ref name="modelDriven" />
<interceptor-ref name="basicStack" />
</interceptor-stack>

How to embed a flash file in a Rails Project

I am trying to embed a flash file onto the homepage of my Ruby application. The homepage is in /app/view/home, and the flash file is in the projects /public/flash/myflash.swf.
When I load the home page, I don't see anything, although the text is bumped below a square of the proper size I defined the file as.
The code I am using to try and load the file is
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="346" height="383" id="Blox" align="middle">
<param name="movie" value="/flash/Blox.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="false" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
</object>
</div>
I am thinking that either I am calling the file wrong by using value=/flash/Blox.swf, or that I am storing my flash file in the wrong place period.
How can I get my flash file to load? Any help is appreciated!
I was able to fix the problem by including and <embed src> tag in the object. Not the best solution, but it worked for what I needed.

Silverlight Webpart Custom Initialization Parameters in Sharepoint 2010

I have a xap file which accepts custom parameters.I have tested it in a HTML page.It works.
"<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="SmoothStreamingPlayer.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50401.0" />
<param name="autoUpgrade" value="true" />
<param name="InitParams" value="selectedcaptionstream=textstream_eng,mediaurl=http://ie1adtvmvrb1s:12345/LiveSmoothVideo.isml/manifest" />
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>"
Here I am passing Intialization parameters like this
selectedcaptionstream=textstream_eng,mediaurl=http://ie1adtvmvrb1s:12345/LiveSmoothVideo.isml/manifest
I am trying to place the same intialization parameters in Silverlight Webpart in Sharepoint 2010. But It didn't load the Xap filele to.I am not able to figure out what is going wrong
When you add the SP Silverlight WP, one of the parameters in the tool part is under "Other Settings > Custom Initialization Parameters" you can define them there.

separate output for different log levels in log4php

im kinda new with log4php..
i need to output the INFO and DEBUG levels in different files.
is that possible?
my xml looks like this:
<appender name="dlog" class="LoggerAppenderRollingFile">
<param name="file" value="C:/log/dlog"></param></appender>
<appender name="ilog" class="LoggerAppenderRollingFile">
<param name="file" value="C:/log/ilog/"></param></appender>
<root>
<level value="DEBUG" />
<appender_ref ref="dlog" ></appender_ref>
</root>
<logger name="myLogger">
<level value="INFO"/>
<appender-ref ref="ilog" />
</logger>
**This outputs only the INFO levels in the corresponding filename
please help :(
thanks a lot.
This can be achieved using multiple appenders with filters and one logger.
Overview
You can define multiple appenders to send the logging to different destinations. We shall define 1 appender for each level and each appender will be logging to different files.
In addition to these, we need to create a filter for each appender. We will use the filter LoggerFilterLevelRange and we shall specify a min and max level. Note the filter LoggerFilterLevelMatch cannot be used as it matches a filter but is neutral to the other filters.
As for the loggers, we shall attach all our appenders to the one and only logger.
This way, you can send the different logging messages to different files depending on the error level.
Configuration
<appender name="dlog" class="LoggerAppenderRollingFile">
<param name="file" value="C:/log/dlog" />
<filter class="LoggerFilterLevelRange">
<param name="levelMin" value="debug" />
<param name="levelMax" value="debug" />
</filter>
</appender>
<appender name="ilog" class="LoggerAppenderRollingFile">
<param name="file" value="C:/log/ilog" />
<filter class="LoggerFilterLevelRange">
<param name="levelMin" value="info" />
<param name="levelMax" value="info" />
</filter>
</appender>
<root>
<level value="INFO" />
<appender_ref ref="ilog" />
<appender_ref ref="dlog" />
</root>
</configuration>
Usage
require_once 'Logger.php';
Logger::configure('log_config.xml');
$logger = Logger::getLogger();
$logger->info('This message is meant to inform.');
$logger->debug('A debug message!');
I hope this helps.
I think the appropriate solution would be to apply a filter and a threshold to your appenders. Like so:
<appender name="dlog" class="LoggerAppenderRollingFile">
<param name="file" value="C:/log/dlog" />
<filter class="LoggerFilterLevelMatch">
<param name="LevelToMatch" value="debug" />
<param name="AcceptOnMatch" value="true" />
</filter>
<filter class="LoggerFilterDenyAll" />
</appender>
<appender threshold="INFO" name="ilog" class="LoggerAppenderRollingFile">
<param name="file" value="C:/log/ilog/" />
</appender>
<root>
<level value="DEBUG" />
<appender_ref ref="dlog" />
<appender_ref ref="ilog" />
</root>
This would only allow messages with debug level into dlog and (due to the threshold) only info and above into ilog. If you didn't want messages above info level in ilog, then you could apply the same filter as with the dlog appender.

Vb.net Visual Studio 2008 log4net multiple modules, same app.config different loggers, dont work

I have 2 console apps projects in the same directory but different projects. There is some common code in the App_Code directory and a common app.config which gets build into seperate .exe.config files.
One module (VScanDemonStarter) starts up and writes to one logger with its own appender going to a seperate file. It uses an process.start() to execute the other module (VScanDemon) in another command prompt hidden window.
When I run VScanDemon by itself it puts entries into its log file. When I run VScanDemonStarter it puts entries into its (different) log file, the VScanDemon log file gets created, but no entries. I can see it is executing because some files get moved from one directory to another. Just no Log entries.
the config looks like
<root>
<level value="INFO" />
</root>
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender" >
<param name="File" value="log/vscandemonstarter.log" />
<param name="AppendToFile" value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%-5p %d{yyyy-MM-dd hh:mm:ss} - %m%n" />
</layout>
</appender>
<appender name="vsdemonlogfileappender" type="log4net.Appender.RollingFileAppender" >
<param name="File" value="log/vscandemon.log" />
<param name="AppendToFile" value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%-5p %d{yyyy-MM-dd hh:mm:ss} - %m%n" />
</layout>
</appender>
and the code bodies set up and call the bodies with.
VScanDemonStarter:
top of module:
Private ReadOnly log As ILog = log4net.LogManager.GetLogger("default")
top of main:
log4net.Config.XmlConfigurator.Configure()
example calls:
If log.IsInfoEnabled Then log.Info("VScanDemonStarter:Main: ----called----")
VBScanDemon:
top of module:
Private ReadOnly log As ILog = log4net.LogManager.GetLogger("VSDemonLogger")
top of main:
log4net.Config.XmlConfigurator.Configure()
VBScanDemon:
If log.IsInfoEnabled Then log.Info("VScanDemon:Main: ----called----")
I don't get any log entries from VScanDemon.
Sorry left out the top of the configuration
<log4net debug="true">
<logger name="default">
<level value="INFO"/>
<appender-ref ref="LogFileAppender" />
</logger>
<logger name="VSDemonLogger">
<level value="INFO"/>
<appender-ref ref="vsdemonlogfileappender" />
</logger>
I have one app.config but two projects in the same directory using it. They generate seperate configs from that one source .exe.config
I looked at the console output from VScanDemon and it looks like it is picking up the configuration with no issues. But still an empty log. I don't know if I need to add a flush or something.
Are you useing the same log4net configuration for both modules?
If not, are they really different at runtime?
I think "default" should return the Root-logger and "VSDemonLogger" the other one but that one is not included in your posted configuration.
EDIT:
AFAIK all logger in the configuration will be "created", which results in the generated log files for your VSDemonLogger and VScanDemonStarter even if you do not use them.
You are using relativ pathes in the configuration, are they still valid for VSDemonLogger if you call it from VScanDemonStarter?