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

Flowplayer: autoPlay: false,autoBuffering: true should not display the video if a splash image is set #104

Open
phloxic opened this issue Oct 14, 2014 · 12 comments

Comments

@phloxic
Copy link

phloxic commented Oct 14, 2014

Flowplayer has a special incantation to pause on the first frame after loading:

clip: {
  autoPlay: false,
  autoBuffering: true
}

With flashls the player gets stuck in loading state, see http://flowplayer.blacktrash.org/test/flashls.html
Can this be solved in flashls?

@mangui
Copy link
Owner

mangui commented Oct 14, 2014

there is a missing else statement here to handle it:
https://github.com/mangui/flashls/blob/master/src/org/mangui/flowplayer/HLSStreamProvider.as#L105-L108
should not be a big deal

@mangui
Copy link
Owner

mangui commented Oct 14, 2014

Hi @blacktrash it should work as expected now, plz check on your side
Cheers
Mangui

@mangui mangui added the bug label Oct 14, 2014
@phloxic
Copy link
Author

phloxic commented Oct 14, 2014

Almost - one of the use cases is to have an image as first item in a playlist and the above incantation for the second item. This results in a so-called "playlist-based splash image". I've updated the demo - the player should stay on the image after load.
I'm aware that this is rather idiosyncratic and especially difficult with any kind of streaming protocol (for RTMP for instance this was only implemented late) - so don't worry if this is too complicated or risks to break other stuff.

@mangui
Copy link
Owner

mangui commented Oct 14, 2014

you mean we should not show the first video frame, just fill the buffer and let the display as it was right ?

@phloxic
Copy link
Author

phloxic commented Oct 14, 2014

If it were that simple ;-) No, without an image as first playlist item the first frame is shown: http://flowplayer.blacktrash.org/test/minimal.html - this scenario is definitely fixed by the change.
Just buffer fill and only show the screen was the RTMP behaviour for a long time; that's why I said, it might get tricky.

@mangui
Copy link
Owner

mangui commented Oct 14, 2014

Ok i Will have a look @ rtmp provider tomorrow to see how it is handled
Cheers.
Mangui

@phloxic
Copy link
Author

phloxic commented Oct 15, 2014

Personally I do not deem this a showstopper - if you foresee to many complications, we can document that http://flash.flowplayer.org/demos/configuration/playlist-splash.html (currently) does not work with this plugin - there's always the possibility of the html based splash setup http://flash.flowplayer.org/demos/installation/splash-image.html which imho is the better way[tm] in most scenarios.

@mangui
Copy link
Owner

mangui commented Oct 15, 2014

it should not be a big deal to implement, if you could tell me how i could detect such conditions from flowplayer flash API perspective.

@phloxic
Copy link
Author

phloxic commented Oct 15, 2014

I'm only familiar with the JS api I'm afraid - I'll ping a Flash developer; don't hold your breath though, we're very busy with other stuff atm, sorry.

@mangui mangui changed the title Flowplayer: autoPlay: false, autoBuffering: true stuck in loading state Flowplayer: autoPlay: false,autoBuffering: true should not display the video if a splash image is set Nov 25, 2014
@phloxic
Copy link
Author

phloxic commented Nov 29, 2014

@mangui - for the time being this can be solved/hacked/worked around with Flowplayer's JavaScript api:

playlist: [{
  url: "mysplash.jpg",
  provider: "http",
  // custom property on load for splash image clip
  init: true
}, {
  url: "myhls.m3u8",
  provider: "hls",
  urlResolvers: "hls",
  autoPlay: false
  // autoBuffering: true // no effect with this hack, and unneeded with hls anyway
}],
clip: {
  onFinish: function (clip) {
    if (clip.type == "image" && !clip.index && this.getPlaylist().length > 1) {
      if (clip.init) {
        this.pause();
        clip.init = false;
      } else {
        this.play(1);
      }
    }
  }
}

Demo here: http://flowplayer.blacktrash.org/test/flashls.html

@phloxic
Copy link
Author

phloxic commented Nov 29, 2014

Note that the above hack obviously cannot be applied to standalone embedded players, e.g. in configurations for sharing where no JS api is available.

@phloxic
Copy link
Author

phloxic commented Sep 7, 2015

FWIW, I can't repro this anymore if I don't set autoBuffering: true, but only autoPlay: false for the video.
It diverges from the usual incantation, but I deem this acceptable (less writing ;-)).

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

No branches or pull requests

2 participants