Skip to content

Instantly share code, notes, and snippets.

@danscotton
danscotton / gist:4124546
Created November 21, 2012 12:01
news_emp_config
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://bbc.co.uk/2008/emp/config" revision="1">
<plugin name="iPlayerLiveStats">
<param name="baseTemplate">http://stats.bbc.co.uk/o.gif?~RS~s~RS~News~RS~t~RS~{t}~RS~i~RS~{i}~RS~p~RS~0~RS~a~RS~{a}~RS~u~RS~{u}~RS~r~RS~{r}~RS~q~RS~x0m=0.19&amp;x0s={x0s}&amp;x0e={x0e}{extendedTemplate}~RS~z~RS~0~RS~</param>
<param name="playTemplate">&amp;amp;xf={xf}&amp;xfc={xfc}&amp;xj={xj}&amp;xp={xp}&amp;xvp={xvp}&amp;xv1={xv1}</param>
<param name="connectionTemplate">&amp;xc={xc}&amp;xcc={xcc}&amp;xce={xce}&amp;xcs={xcs}&amp;xf={xf}&amp;xfc={xfc}&amp;xmt={xmt}</param>
<param name="playingTemplate">&amp;xb={xb}&amp;xba={xba}&amp;xbc=0&amp;xc={xc}&amp;xcc={xcc}&amp;xj={xj}&amp;xfc={xfc}&amp;xfo={xfo}&amp;xmt={xmt}&amp;xs1={xs1}&amp;xta={xta}&amp;xtd={xtd}&amp;xtp={xtp}&amp;xvp={xvp}&amp;xz1={xz1}&amp;xv1={xv1}</param>
<param name="endTemplate">&amp;xfc={xfc}&amp;xs1={xs1}&amp;xta={xta}&amp;xtd={xtd}&amp;xtp={xtp}&amp;xvp={xvp}&amp;xz1={xz1}&amp;xv1={xv1}</param>
@danscotton
danscotton / gist:4072881
Created November 14, 2012 15:46
emp init
var emp = new embeddedMedia.Player();
emp.setWidth(that.options.width);
emp.setHeight(that.options.height);
emp.setDomId(that.options.id);
emp.setPlaylist(that.options.playlist);
emp.setMediator({
'host': 'open.live.bbc.co.uk'
});
Feature: Media asset page
As a user
I want to be able to select an item from a variety of media and associated metadata on any device
So that I can watch or listen wherever or however I choose
@javascript
Scenario: Expand Top stories # features/media_asset_page.feature:28
Given there is a media asset page # features/step_definitions/media_asset_page_steps.rb:13
And there are 12 items in the Top stories feed # features/step_definitions/media_asset_page_steps.rb:18
When I visit the media asset page # features/step_definitions/media_asset_page_steps.rb:43
bbc-annotate-flagpole-tabloid-1.02-807866.1.noarch.rpm
bbc-flagpole-tabloid-1.02-807807.1.noarch.rpm
bbc-annotate-flagpole-tabloid-1.02-957878.26.noarch.rpm
bbc-flagpole-tabloid-1.02-957878.26.noarch.rpm
bbc-imagechef-tabloid-1.2-3655.141.noarch.rpm
bbc-pal-cirrus-1.2-3655.141.noarch.rpm
bbc-pal-jibbajabba-1.2-3655.141.noarch.rpm
bbc-pal-library-berliner-1.2-3655.141.noarch.rpm
bbc-pal-library-news-core-1.2-3655.141.noarch.rpm
bbc-pal-newspopular-1.2-3655.141.noarch.rpm
@danscotton
danscotton / gist:3378685
Created August 17, 2012 13:26
supporting multiple languages
// ----------------------------------------
// english site
<html lang="en">
// default typography in here
body {
font-family: Helvetica, Arial, sans-serif;
font-size: xx;
line-height: xx;
}
@danscotton
danscotton / gist:3188452
Created July 27, 2012 14:47
empFacade tests
define('http://emp.bbci.co.uk/emp/clear/embed.js', function() {
var api = {
setWidth: sinon.spy(),
setHeight: sinon.spy(),
setDomId: sinon.spy(),
setPlaylist: sinon.spy(),
write: sinon.spy(),
setMediator: function() {},
set: function() {}
@danscotton
danscotton / gist:3187758
Created July 27, 2012 12:50
Mocking an AMD dependency that returns a constructor with sinon.js
// GOAL:
// To test that VideoLoader creates Emp with the correct parameters.
/**
* VideoLoader (module/media/videoLoader)
* - has Emp (a bbc video player) as a dependency
*/
define(['module/media/emp'], function(Emp) {
var VideoLoader = function(placeholder, meta, EmpStub) {
this.canPlayHls = featureDetector.can('PlayAppleHls') && (/(Macintosh|iPod|iPad|iPhone)/).test(navigator.userAgent);
@danscotton
danscotton / gist:3176063
Created July 25, 2012 13:02
major vs minor breakpoints
-----
MAJOR
-----
These are what I refer to as 'major' breakpoints. They're defined on our link tags, and are on the 'outside'.
All of our stylesheets are conditionally inserted (based off window innerWidth/innerHeight) into the page dynamically using javascript.
<head>
...
<link rel="stylesheet" type="text/css" href="compact.css" media="(max-width: 640px)" />
<link rel="stylesheet" type="text/css" href="tablet.css" media="(min-width: 641px)" />
@danscotton
danscotton / gist:3164620
Created July 23, 2012 16:41 — forked from froots/gist:3164377
mocking with amd
// ----------------------------------------
// /path/to/dependency.js
define(function() {
return {
doSomethingWithIt: function() {
// blah
}
};
});