Giter Site home page Giter Site logo

Comments (4)

robwalch avatar robwalch commented on August 29, 2024

The "primary" option accepts only two values, "html5" (default) and "flash". These apply to jwplayer's providers. They have no affect on custom JS providers.

When you register a custom JS provider, that provider will be checked before html5 and flash. If that provider is not supported, playback will fall-through to html5 and flash (flash first if "primary" "flash" is set).

The playlist item's Flash provider will only be used if the JW Player flash provider is used. If your JS provider always reports that it can play the item, then Flash will never be selected. You need to allow you JS provider to fall-through by modifying it's supports method, or not register your JS provider and set "primary" to "flash".

from jwplayer.

donato avatar donato commented on August 29, 2024

The name for built-in providers is set here :

For a newly registered provider it is set using it's getName method :

var name = provider.getName().name;

Like Rob said, the "primary" toggle in JWPlayer only affects built-in html5 versus built-in flash. Any custom providers will ALWAYS have priority over the built-in providers. Priority dependent upon the order they were registered.

from jwplayer.

robwalch avatar robwalch commented on August 29, 2024

A "hybrid" js provider that can use either technology could be ideal, but we have not developed such an example. Flash provider support remains a legacy feature we've kept around from version 6 "as-is".

What I would do is only specify the source "provider" with the "link-to-flash-provider" if you want to use Flash. Then you can modify your JavaScript provider's supports method as follows:

Html5Provider.supports = function(source) {
     if (!!source.provider) {
        // If a custom Flash provider is specified, do not use custom JS provider
        return false;
    }
    ...
};

// registering html5p provider here
jwplayer.api.registerProvider(Html5Provider);

// load player
jwplayer('player').setup({
        playlist: [{
            file: 'link-to-stream,
            // only add this if you want to use the custom Flash provider
            provider: 'link-to-flash-provider'
        }],
        primary: 'flash'
    });

You could also use a different config property in the source if you prefer. Setting primary to "flash" means that if the custom JS provider is not used, Flash will be used and it will load your custom Flash provider.

from jwplayer.

donato avatar donato commented on August 29, 2024

@shaharmor - please re-open if you have further questions

from jwplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.