Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: gracefull solution not used (e.g fail use Aurora for FLAC) #310

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

imShara
Copy link

@imShara imShara commented Apr 24, 2015

E.g fail use Aurora for FLAC if tag does not support this because solution (e.g Aurora) marked as {desired: false} and {support: false} when {canPlay: true} too.

What i need:

setMedia MP3 or OGA or FLAC
jPlayer params {supplied:"mp3,oga,flac"}

If browser doesn't support format in html5 use aurora as solution
{solution: "aurora", auroraFormats:"flac"}

And here is problem:

if {solution: "html,aurora", supplied:"mp3,oga,flac"}
mp3: plays
oga: plays
flac: fail

if {solution: "html,aurora", supplied:"flac"}
mp3: fail
oga: fail
flac: plays

if {solution: "aurora", supplied:"mp3,oga,flac"}
mp3: fail
oga: fail
flac: plays

P.S

Please, check code around this place, i can't understand it. E.g

$.each(this.solutions, function(solutionPriority, solution) {
    if(solutionPriority === 0) { // Why first solution already desired?
        self[solution].desired = true;
    } else {
        var audioCanPlay = false;
        var videoCanPlay = false;
        $.each(self.formats, function(formatPriority, format) {
            if(self[self.solutions[0]].canPlay[format]) { // Why [0]? Maybe [solutionPriority]?
                if(self.format[format].media === 'video') {
                    videoCanPlay = true;
                } else {
                    audioCanPlay = true;
                }
            }
        });
        self[solution].desired = (self.require.audio && audioCanPlay) || (self.require.video && videoCanPlay);
    }
});

…dio> tag does not support this) because solution (e.g Aurora) marked as {desired: false} and {support: false} when {canPlay: true} too.
@Phyks
Copy link

Phyks commented Jul 31, 2016

Oops, I just saw this PR at the moment. I wrote a similar one (#365), not sure which one is the best.

@imShara
Copy link
Author

imShara commented Aug 2, 2016

@Phyks, JPlayer is dead, use simple custom wrapper over audio tag and Aurora polyfill

@Phyks
Copy link

Phyks commented Aug 2, 2016

@imShara do you have any feedbacks on such solutions? Have you tried Howler.js for instance?

This issue affects Ampache a lot and we are hesitating between trying to fork and kind of patch jPlayer or just move to another solution.

@imShara
Copy link
Author

imShara commented Aug 5, 2016

@Phyks, I made myown simple solution with plain js api. Actually, we don't need any frameworks to play sound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants