Skip to content

Instantly share code, notes, and snippets.

@tophtucker
Last active April 10, 2017 19:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tophtucker/4bfe467ba870734de86c to your computer and use it in GitHub Desktop.
Save tophtucker/4bfe467ba870734de86c to your computer and use it in GitHub Desktop.
Fluid/responsive Bloomberg video player

Wraps the Bloomberg video player in a fluid container that maintains aspect ratio.

  1. Click the 'Share' button and copy the embed code from a Bloomberg video
  2. Paste where it says <!-- PASTE STANDARD EMBED CODE HERE -->
  3. In the embed code, change "offsite_embed":true to "offsite_embed":false

N.B.: The video-wrapper should not contain anything else! If you want to add a caption or something, do it outside.

<!DOCTYPE html>
<meta charset="utf-8">
<style>
.video-wrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
}
.video-wrapper-inner {
width: 100%;
height: 0;
position: relative;
padding-top: 56.25%;
}
.video-wrapper-inner > div {
position: absolute;
top: 0;
width: 100% !important;
height: 100% !important;
}
</style>
<div class="video-wrapper">
<div class="video-wrapper-inner">
<!-- PASTE STANDARD EMBED CODE HERE -->
<script src='//cdn.gotraffic.net/projector/latest/bplayer.js'>BPlayer(null, {"id":"Zjhq8dzlSSax4II~0Gs3tQ","htmlChildId":"bbg-video-player-Zjhq8dzlSSax4II~0Gs3tQ","serverUrl":"http://www.bloomberg.com/api/embed","idType":"BMMR","autoplay":false,"video_autoplay_on_page":false,"log_debug":false,"ui_controls_popout":false,"use_js_ads":true,"ad_code_prefix":"","ad_tag_gpt_preroll":true,"ad_tag_gpt_midroll":true,"ad_tag_sz_preroll":"1x7","ad_tag_sz_midroll":"1x7","ad_tag_sz_overlay":"1x7","ad_network_id_preroll":"5262","ad_network_id_midroll":"5262","ad_network_id_overlay":"5262","ad_tag_cust_params_preroll":"","ads_vast_timeout":10000,"ads_playback_timeout":10000,"wmode":"opaque","use_comscore":true,"comscore_ns_site":"bloomberg","comscore_page_level_tags":{"bb_brand":"bbiz","bss_cont_play":0,"bb_region":"US"},"use_chartbeat":true,"chartbeat_uid":"15087","chartbeat_domain":"bloomberg.com","use_share_overlay":true,"share_metadata":{"canonical_url":"http://bloom.bg/1KMEKax"},"vertical":"business","ad_tag_overlay":"business/videooverlay","zone":"video","source":"BBIZweb","module_conviva_insights":"enabled","conviva_account":"c3.Bloomberg","width":640,"height":360,"ad_tag":"","ad_tag_midroll":"","offsite_embed":false});</script>
<!-- END PASTE STANDARD EMBED CODE HERE -->
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment