Embedding - Advanced topics

4.1 Embed-Code Parameters

Most playout settings can be overridden by embed-code parameters.

Moreover, a selected subset of settings can be made exclusively by using an embed-code parameter. They are:

Name Type Value
dfp_adunit_l1 String level-1 ad unit *
dfp_adunit_l2 String level-2 ad unit *
dfp_adunit_l3 String level-3 ad unit *
dfp_adunit_l4 String level-4 ad unit *
dfp_adunit_l5 String level-5 ad unit *

4.1.1 Embed-Code Parameters for Commercial Targeting

Often when targeting commercials, custom macros are needed. Since v5.35, the player implements this facility, substituting %%<key>%% with the value part of the macro_<key>=<value> embed-code parameter.

An example: If we have an ad tag url
booked in the preroll position of the default playout, then embedding the player with
results in the player requesting a preroll ad from

4.2 Responsive Design

The best way to make the player scale in a responsive design is setting its width and height to '100%' and wrap it inside a <div> that you control the dimensions of.

4.3 Embed dynamically

It is possible to place the player embed script at the bottom of the page and let place the player after a specific element on the page. For further information please refer to the Playout setting "Placement options" (Chapter 2.7.6)

4.4 Just-In-Time Embedding

Sometimes it is more convenient to have the player load on demand, for instance when preloading a player in the background once the page is complete.

Please refer to our Player API page to see an example.

4.5 Embedding using Zones

If your contract allows it, you can wrap your player in a 'zone' and embed the 'zone' using a zone-embed code.

4.6 Embedding on Facebook

To embed your video inline on Facebook, og-tags need to be added besides the player embed code on your website.
More information concerning og-tags can be found in the Public API: External metadata generator documentation.

4.7 Embedding of YouTube-hosted video

As of version 5.38, a dedicated embed code is available for YouTube hosted video. Upon request, designated playouts can be enabled for use with this embed code, which looks like: https://<publication>.bbvms.com/p/<playout>/y/<youtubeId>.html (mind the '/y/' where you would expect '/c/').

4.8 Embedding in-app

For embedding our player inside a native app (in-app) you're advised to use our dedicated player SDK's. If for some reason you can't, and your iOS app uses a WkWebView, you can of course use a standard js embed code. There are some caveats, though.

In the iOS app's source code, you should include:

  2. // target is higher than iOS 9.3.1
  3. self.wkWebViewConfiguration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
  4. #else
  5. self.wkWebViewConfiguration.requiresUserActionForMediaPlayback = NO;
  6. #endif

And ideally, implement a navigation policy:

  1. class WKWebViewController: UIViewController, WKUIDelegate, WKNavigationDelegate {
  3. // Creates the WKWebView
  4. let webConfiguration = WKWebViewConfiguration()
  5. webConfiguration.allowsInlineMediaPlayback = true
  6. webConfiguration.mediaPlaybackRequiresUserAction = false
  7. wkWebView = WKWebView(frame: .zero, configuration: webConfiguration)
  8. wkWebView!.navigationDelegate = self
  9. wkWebView!.uiDelegate = self
  12. func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {
  13.     // Capture window.open (clickthroughs) and redirect
  14.     webView.load(navigationAction.request)
  15.     return nil
  16. }

Once you have this in place, you should either use a dedicated playout for in-app, enabling 'Force "can autoplay"', or embed with ?forceCanAutoPlay=true appended to the embed url.

In your Android app, it should also be possible to use a standard js embed code. Add cleartextTrafficPermitted=“true” to the app manifest file.