Trailer for ‘Captain Phillips’: a True Story About the Somali Pirate Hijacking Starring Tom Hanks

by 7 years ago

supports_local_storage = function () {
try {
return ‘localStorage’ in window && window.localStorage !== null;
} catch (e) {
return false;
}
};

mediaPreference = function (pref) {
if (pref === ‘html’ && checkGuardianCodecs()) {
localStorage.setItem(“mediaPreference”, pref);
return “You have set your audio/video preference to ‘html’. Run this function again with a blank argument to reset to Flash. Some of our videos are only available in Flash.”;
} else if (pref === ‘html’ && !checkGuardianCodecs()) {
localStorage.setItem(“mediaPreference”, ”);
return “Sorry, your browser doesn’t support our audio/video formats. Audio/video will display via Flash.”;
} else {
localStorage.setItem(“mediaPreference”, ”);
return “Audio/video files will display via Flash.”;
}
};

preferHTMLMedia = function () {
if (supports_local_storage()) {
if (localStorage.mediaPreference === ‘html’) {
return true;
} else {
return false;
}
}
};

checkGuardianCodecs = function () {
if (checkh264() && checkmp3()) {
return true;
}
};

checkh264 = function () {
var v = document.createElement(“video”);
if (v.canPlayType(‘video/mp4’) !== ”) {
return true;
} else {
return false;
}
};

checkmp3 = function () {
var a = document.createElement(“audio”);
if (a.canPlayType(‘audio/mpeg’) !== ”) {
return true;
} else {
return false;
}
};

ensurePackage(‘guardian.video’);

guardian.video[‘comScoreTracker’] = {
config : {
clientId : “6035250”,
url : “http://b.scorecardresearch.com/p”
},
track : function(c5Value) {
var payload = {
c1 : 1,
c2 : this.config.clientId,
c5 : c5Value
};
var trackingUrl = this.config.url + “?” + jQuery.param(payload);
jQ(‘#comScoreTracker’).attr(“src”, trackingUrl);
},
videoStart : function(event) { guardian.video.comScoreTracker.track(’02’); },
preRollStart : function(event) { guardian.video.comScoreTracker.track(’09’); },
init : function() {
if(true) {
jQ(window).bind(‘gu.video.start’, guardian.video.comScoreTracker.videoStart);
jQ(window).bind(‘gu.video.preRollStart’, guardian.video.comScoreTracker.preRollStart);
}
}
};

var autoPlay = (jQ.cookie(‘GU_VIDEO_SETTINGS’) !== ‘false’ || ‘VIDEO’ != ‘VIDEO’);
var adSnippet = “@” + OAS_listpos + “,x40!x40?cue=pre&”;

var vtIsAdvert = function() {
return true === (jwplayer.getPlayers(0)[0].getPlaylist()[0].ovaAd)
}

var videoAdChecking = {
preRoll : function() { return jwplayer.getPlayers(0)[0].getPlaylist()[0].ovaAdType === “pre-roll” ; },
postRoll : function() { return jwplayer.getPlayers(0)[0].getPlaylist()[0].ovaAdType === “post-roll” ; }
};

var vtOnce = function(func) {
var ran = false;
return function() {
if (ran) return;
ran = true;
return func.apply(this, arguments);
}
}

var vtTrackUserInteraction = function(type, name) {
//console.log(“vtTrackUserInteraction: type=” + type + “, name: ” + name);
s.prop41 = type;
s.linkTrackVars = “prop43,prop44,prop45,eVar43,eVar44,eVar45,prop41,events”;
var event = “event14”;
s.linkTrackEvents = event;
s.events = event;
s.tl(true, “o”, name);
}

var vtInvokeFullscreen = vtOnce(function() { vtTrackUserInteraction(“Full Screen”, “User Changed Full Screen”); });
var vtInvokeVolume = vtOnce(function() { vtTrackUserInteraction(“Volume”, “User Changed Volume”); });

flashVars = ‘playerID=26396137001&@videoPlayer=null&domain=embed&autoStart=’ + autoPlay + ‘&adServerURL=http%3A%2F%2Foas.guardian.co.uk%2F2%2Fwww.guardian.co.uk%2Ffilm%2Fvideo%2F2013%2Fmay%2F08%2Fcaptain-phillips-trailer-exclusive-video%2Foas.html%2F1’ + OAS_rns + ‘%40’ + OAS_listpos + ‘%2Cx40%21×40%3Fk%3Dsomalia%26k%3Dpaulgreengrass%26k%3Dfilm%26k%3Dculture%26k%3Dpiracy%26k%3Dtomhanks%26k%3Dactionandadventure%26cf%3Dfilm%2Breviews%26pid%3D%26ct%3Dvideo%26pt%3Dvideo%26videoId%3Dnull’;

var adVars = ”;
try {
adVars += localStorage.getItem(‘aparams’);
} catch(er) {
// Ignore
}
try {
adVars += localStorage.getItem(‘qcparams’);
} catch(er) {
// Ignore
}
try {
adVars += localStorage.getItem(‘gdncrmparams’);
} catch(er) {
// Ignore
}
if (adVars != ”) {
adVars = ‘&’ + adVars;
}
if (OAS_query != ”) {
adVars += ‘&’ + OAS_query;
}

jQ(‘document’).ready(function() {
if (typeof(s_loadMediaModule) != ‘undefined’) {
s_loadMediaModule(s);
}

guardian.video.comScoreTracker.init();

var containerID = “video-408499889-1368052457801”,
playerName = “JW Player ” + jwplayer.version,
mediaName = “Captain Phillips: watch the exclusive trailer for Paul Greengrass’s Soma:Video:1904932”,
hasAdStarted = false,
provider = “Columbia Pictures”,
restricted = false;
initialAdPlay = true,
initialContentPlay = true,
l2content = ”;

jwplayer(“video-408499889-1368052457801”).setup({
flashplayer: “http://static.guim.co.uk/flash/jwplayer/jwplayer-5.10.swf”,
file: “http://cdn.theguardian.tv/mainwebsite/2013/5/8/130508CaptainPhillips-16×9.mp4”,
image: “http://brobible.com/wp-content/uploads/2013/05/captain-phillips-trailer–001.jpg”,
events: {
onPlay: function() {
l2content = s.channel;; // Copy level 2 content title from channel

if (vtIsAdvert()) {
// Track Video advert
s_trackVideoAd(s, l2content);

if (initialAdPlay) {
initialAdPlay = false;
s.Media.open(mediaName, jwplayer().getDuration(), playerName);
}

s.Media.play(mediaName, jwplayer().getPosition());

hasAdStarted = true;
if(videoAdChecking.preRoll()) { jQ(window).trigger(‘gu.video.preRollStart’); }
if(videoAdChecking.postRoll()) { jQ(window).trigger(‘gu.video.postRollStart’); }

} else {
// Track Video content
s_trackVideoContent(s, l2content, provider, restricted);

if (initialContentPlay) {
initialContentPlay = false;
s.Media.open(mediaName, jwplayer().getDuration(), playerName);
}
s.Media.play(mediaName, jwplayer().getPosition());
}

jQ(window).trigger(‘gu.video.start’);

},

onPause: function() {
s.Media.stop(mediaName, jwplayer().getPosition());
},

onBuffer: function() {
s.Media.stop(mediaName, jwplayer().getPosition());
},

onSeek: function(event) {
s.Media.stop(mediaName, event.position);
s.Media.play(mediaName, event.offset);
},

onFullscreen: vtInvokeFullscreen,

onVolume: vtInvokeVolume
},
skin: “http://brobible.com/wp-content/uploads/2013/05/canute.zip”,
mute: false,
plugins: {
http://static.guim.co.uk/flash/jwplayer/related.js’ : {
heading: ‘Popular video’,
file: ‘http://popular-content.appspot.com/api/popular/video/rss’,
onclick: ‘link’,
dimensions: ‘160×90′,
usedock: false
}
,’http://static.guim.co.uk/flash/jwplayer/plugins/ova-jw-1.1/ova-jw.js’ : {
“player”: {
“controls” : {
“vpaid” : {
“visible” : true
}
},
“modes”: {
“linear”: {
“controls”: {
“enableFullscreen”: true,
“enablePlay”: true,
“enablePause”: true,
“enableMute”: true,
“enableVolume”: true
}
}
}
},
“delayAdRequestUntilPlay” : true,
“clearPlaylist” : false,
“debug”: {
“levels” : “none”
},
“ads” : {
“schedule” : [
{
“position” : “pre-roll”,
“playOnce” : true,
“tag” : “http://oas.guardian.co.uk/2/” + OAS_sitepage + “/1” + OAS_rns + adSnippet + OAS_query
}
]
}
}
},
width: 620,
height: 373,
duration: 158,
menu: true,
autostart: autoPlay,
“dock”: true,
“controlbar.position”: “bottom”
});
});

Brandon Wenerd is BroBible's publisher and founding partner, overseeing partnerships and content on all channels in Los Angeles. A graduate of Penn State, he loves live music, Phish, the Grateful Dead, Philly sports, and adventures of all kinds. He can be reached at brandon@brobible.com

TAGSmovie trailersTom Hanks