Mux Integration

Integrate real-time video watch data from Mux Data.

📘

Mux streaming data exports are only available on select Mux Data plans.

Flike integrates with Mux Data to obtain video interaction data in real time. We optionally also provide a JavaScript library to wrap the Mux Player with a convenient interface for getting recommendations or enabling auto-play of recommended videos.

Integrating Mux Data

  1. Log in to your mux dashboard and click Settings → Streaming Exports → New streaming export.
  2. Choose the environment (e.g. Production) you want to integrate and set the Service to Google Cloud Pub/Sub.
  3. Use the following Pub/Sub topic name, where ${customerId} is your Flike customer Id:
    projects/goflike/topics/mux-ingest-${customerId}
    
  4. Click Enable export - that's it!

Integrating with the Mux Player

We provide a JavaScript package @flike/mux-player-plugin to integrate into the Mux Player. This plugin automatically uses the viewer-user-id set in the player, and provides convenient options such as enabling auto-play of recommended videos.

import FlikeMuxPlayerPlugin from '@flike/mux-player-plugin'

const muxPlayer = document.getElementById('my-mux-player')
const recommender = FlikeMuxPlayerPlugin.attach(muxPlayer, {
  apiKey: 'public.ABCDEFGHIJKLMNOPQRSTUVWXYZ', // your public API key
  autoplayNext: true,
  autplayWaitDuration: 3,
})

// fetch 4 recommeded videos
const nextVideos = await recommender.recommend(4)
// [ { assetId: 'xyz', probability: 0.4804032 }, ... ]

Did this page help you?