Skip to content

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

Open
imShara wants to merge 1 commit into
jplayer:masterfrom
imShara:fix
Open

Fix: gracefull solution not used (e.g fail use Aurora for FLAC)#310
imShara wants to merge 1 commit into
jplayer:masterfrom
imShara:fix

Conversation

@imShara

@imShara imShara commented Apr 24, 2015

Copy link
Copy Markdown

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

Phyks commented Jul 31, 2016

Copy link
Copy Markdown

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

@imShara

imShara commented Aug 2, 2016

Copy link
Copy Markdown
Author

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

@Phyks

Phyks commented Aug 2, 2016

Copy link
Copy Markdown

@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

imShara commented Aug 5, 2016

Copy link
Copy Markdown
Author

@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