Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

set primary with JavaScript


It was mentionen in the link at the bottom of this post, that we should set the primary as "flash" when the computer is running Safari on OSX and iOS.

In this manner we work around the problem of that combination not showing the multibit menu. Have been looking for an example of how to do this with the JW JavaScript API, have not been able to find an example on this site. Can someone point me to an example of how this can be done? Thank you.

3 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

How about a toggle option?


0 rated :

Thank you for the example. We have opted to go with switching the primary through JavaScript. Placing a button on the player and then assuming users know when to use it, wasn't the route for us.

Going to paste what will be a partial solution which will hopefully help others...partial becuase everyone probably has script already to detect browser, os, etc..

// BEGIN JavaScript section of your code ---------
var primary = getPrimaryRenderingMode();

// configuration Player 0
sources: [
{file: "your_file_here_1"},
{file: "your_file_here_2"}
rtmp: {
bufferlength: 0
primary: primary,
autostart: false,
fallback: false

function getPrimaryRenderingMode() {
if(<logic to determine if primary should be set to "flash">) {
return 'flash';
// otherwise return "html5"
return 'html5';

// END JavaScript

Thanks again

Ethan Feldman

JW Player Support Agent  
0 rated :

Np :)

This question has received the maximum number of answers.