Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Pseudo Streaming - seek ahead of buffer in Flash #13

Closed
doublex opened this issue Apr 23, 2013 · 55 comments
Closed

Pseudo Streaming - seek ahead of buffer in Flash #13

doublex opened this issue Apr 23, 2013 · 55 comments

Comments

@doublex
Copy link

doublex commented Apr 23, 2013

Webserver-modules like "ngx_http_mp4_module" or "mod_h264_streaming" allow Flash-clients to seek a video beyond the downloaded buffer line, using a "start"-parameter, e.g.:
http://server.com/path/to/video.mp4?start=10

The article about JWPlayer mentions this feature:
http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12534/video-delivery-http-pseudo-streaming

Thanks a lot
Markus

other keywords: byte range request

@shir
Copy link

shir commented Aug 2, 2013

Any updates on this feature?

@heff
Copy link
Member

heff commented Aug 2, 2013

No, no one's stepped up to implement this yet, and we've got HLS and RTMP ahead of it on the priority list.

@mariolorente
Copy link

The only thing you can do is adding a flv source to the video so flash is able to seek it..

@foxx
Copy link

foxx commented Oct 10, 2013

Any news on this? I would have tried to fix myself, but my flash skills are terrible.

@lazarolemos
Copy link

Hi, any news?

@heff
Copy link
Member

heff commented Nov 1, 2013

Sorry, no news on this yet. The usual contributors are busy with other priorities. If anyone's interested in trying, feel free to post questions here.

@papoola
Copy link

papoola commented Mar 4, 2014

@heff any news on this? Can you help me in right way, maybe I could contribute

@heff
Copy link
Member

heff commented Mar 4, 2014

If you have time to attempt this that would be great! I don't have the Flash knowledge to tell you the right way to go about it, but if you search for flash pseudo streaming you may find some example implementations.

@heff
Copy link
Member

heff commented Mar 4, 2014

@papoola, you might check out the notes on #83.

@papoola
Copy link

papoola commented Mar 4, 2014

@heff thanks this is a big help from @ange007 already. I will take a look later on, see if its easy to do.

@ange007
Copy link

ange007 commented Mar 26, 2014

Hello,
there are no news?

@papoola
Copy link

papoola commented Mar 26, 2014

@ange007 I played a bit with the code today, and this is so far as I have come papoola@959c63e

I can't test the code and I think there are more changes needed. Practically I need you or / and some other people to help testing and finding errors. There is a new param introduced which you can pass to to new SWF file : pseudoStreamStartParam. If you set this param then it should load new url. Again this is very beta and we need lot of testing and fixing before I can do a PR

@ange007
Copy link

ange007 commented Apr 7, 2014

@papoola, I took the changed *.swf file, and checked so:

vjs.Flash.prototype.play = function(){
    this.el_.vjs_setProperty('pseudoStreamStartParam', 'start');
    this.el_.vjs_play();
};

But it didn't work, there are no requests when rewinding.

@papoola
Copy link

papoola commented Apr 8, 2014

@ange007 is it possible for you to set a test video on a remote server with ?start=.. support so I can test this. Or if you know a simple node module for psuedo stream server I could try to implement this in code for testing.

@doublex
Copy link
Author

doublex commented Apr 8, 2014

Like this?
http://108.59.11.202/sleep-crying-baby.mov?start=30
Thanks

@ange007
Copy link

ange007 commented Apr 8, 2014

Excuse - my error, it is necessary to write so:

        // Merge default flashvars with ones passed in to init
        flashVars = vjs.obj.merge({

          // SWF Callback Functions
          'readyFunction': 'videojs.Flash.onReady',
          'eventProxyFunction': 'videojs.Flash.onEvent',
          'errorEventProxyFunction': 'videojs.Flash.onError',

          // Player Settings
          'autoplay': playerOptions.autoplay,
          'preload': playerOptions.preload,
          'loop': playerOptions.loop,
          'muted': playerOptions.muted,

          //@todo: PseudoStreaming check
          'pseudoStreamStartParam': 'start'

        }, options['flashVars']),

or

    //@todo: PseudoStreaming check
    if( options.pseudoStreamStartParam )
    {
        flashVars['pseudoStreamStartParam'] = options.pseudoStreamStartParam;
    }

So parameter is transferred, but the number in an incorrect format is visible, or still something - video starts playing with the beginning.

*.flv?start=1065.8673913043476

@ange007
Copy link

ange007 commented Apr 16, 2014

Having taken as a basis @papoola development already some things to mind, but there is a nuance:
For MP4, the start ( ?start=* ) parameter needs to be transferred in seconds, and for FLV in milliseconds.
I don't know what to invent.

@heff
Copy link
Member

heff commented Apr 16, 2014

@papoola, the work you're doing looks good. Can we get a pull request on the main repo?

@ange007 we could pass the source.type value through to Flash.
https://github.com/videojs/video.js/blob/v4.5.2/src/js/media/flash.js#L70

@papoola
Copy link

papoola commented Apr 17, 2014

@ange007 so I just need to fix this *.flv?start=1065.8673913043476 to *.flv?start=1065 and maybe introduce a new param for switching between seconds / milliseconds ?

@heff i think if we fix these issues I could do a PR

@doublex thanks ! I will use this for testing

@ange007
Copy link

ange007 commented Apr 17, 2014

@papoola, now I will lay out the corrected version.
Whether also we will look correctly I made, and that it is necessary to complete (at present I test everything).

@ange007
Copy link

ange007 commented Apr 17, 2014

@papoola, look at it: https://github.com/ange007/video-js-swf/commit/b3b7f1e65a3f5aef666d42eaf22863233e08e9a4
@heff, I will look, thanks. But how to be if source.type it isn't specified?
I for example don't use it at player creation.

@papoola
Copy link

papoola commented Apr 17, 2014

@ange007 wow looks like you have been working alot :) I am reviewing changes, trying to understand the code - particularly looking at role of startOffset

@ange007
Copy link

ange007 commented Apr 26, 2014

I filled in one more commit: https://github.com/ange007/video-js-swf/commit/e572cb5367475a920b098f5ba50e5dd00afbffef

Current visible problems:

  • FLV of video is downloaded correctly, but isn't reproduced.
  • If during loading of new part to change the player size - the size of a shot doesn't change.

P.S. It is probably necessary to clean the buffer somehow?

@mwisnicki
Copy link

Is it possible to do it with standard HTTP range requests (i.e. same as browsers with video tag) ?

@casperbiering
Copy link

@mwisnicki : To my understanding, the Flash Player doesn't support byte range requests.

@foxx
Copy link

foxx commented Feb 4, 2015

Given the situation with Flash, personally I'd say this isn't required anymore. Modern browsers are more than capable of playing videos, and supporting this ancient flash technology only prolongs inevitable deprecation of this dead-in-the-water technology.

@zofrex
Copy link

zofrex commented Feb 5, 2015

If that's the case then remove the flash fallback entirely. While the flash fallback exists, I think it makes sense to keep its features as close to parity with the JS player as possible.

FWIW I think there's still a need for the Flash fallback, as not all browser + O/S combinations support all video formats yet.

@foxx
Copy link

foxx commented Feb 5, 2015

@zofrex The sooner Flash dies, the better, and it's the same principle as those who argue that IE8/9 should be supported. If everyone kills support for these products, people will upgrade a lot quicker and the world will be a better place. In fact just one hour ago, we have 15 new vulns for Flash... And these are just the ones we know about.

@dominic-p
Copy link

@foxx, that's a valid point, but I think you also have to consider why people want to use a library like Video.js. If we only cared about modern browsers, we could save ~80K and just use native HTML5 for a lot of applications. The last time I checked, IE8 still has significant market share, so a lot of people can't afford to leave those users out. Just my 2 cents. :)

@foxx
Copy link

foxx commented Feb 5, 2015

@dominic-p Agreed, and you've hit the nail on the head, the catch 22 of market share. They continue to hold market share because we allow them to, and getting all corporations to drop IE8 support would be like herding cats. The moment one company drops support for it, another will step up and use their legacy support as a marketing advantage lol. Plenty of people out there will to sacrifice developer sanity for the sake of profits and market share. I'm almost certainly off-topic now, but more than happy to continue this convo on Reddit :)

@omni1000
Copy link

It's quite sad that almost 2 years later now this has not been implemented yet.
We have nearly 8% of our users who still can not view HTML5 video properly, so we are forced to use flash. But then we put ourselves in a position where we have to explain why "others" can have the seeking feature and we can not.

@dave-hansen
Copy link

@omni1000

This stuff isn't easy. Flash wasn't built with this in mind. Everyone here happens to be a volunteer and is working hard to build out this feature on their own time. If you rely upon video-js-swf for your business already, these folks deserve your gratitude and respect for their very hard work.

Can you offer any suggestions to give back and contribute to the development? Do you have any time to volunteer for reviewing code or testing? I'd contact you with some ideas, but it looks like your account was just created today.

On Feb 27, 2015 7:02 AM, "omni1000" notifications@github.com wrote:

It's quite sad that almost 2 years later now this has not been implemented
yet.
We have nearly 8% of our users who still can not view HTML5 video
properly, so we are forced to use flash. But then we put ourselves in a
position where we have to explain why "others" can have the seeking feature
and we can not.


Reply to this email directly or view it on GitHub
#13 (comment).

@foxx
Copy link

foxx commented Feb 27, 2015

Personally I'd say force people to upgrade their browsers, Flash will be dead in a few years anyway.

@papoola
Copy link

papoola commented Feb 27, 2015

Yeah only reason we needed this feature was to support preview files of our media in all browsers, and we had chosen mp4.

Only browser which needed flash fallback in order to play mp4 was FF until recently they also decided to support mp4.

So we are now happy that playback and partial requests work out of the box with mp4 and almost any browser without use of Flash :-)

@omni1000
Copy link

@dave-hansen You are absolutely correct, unfortunately I can not volunteer any time to the project. My respect for everyone involved is big and I am thankful for all the progress being done.

While my "tone" may have left the wrong impression, my comment was more directed towards the fact that being such a successful project, one would expect VideoJS to be able to handle seeking with flash. Not because it is easy, but because the project has become very important and has grown big, and as such it is now being used in production by many, including the service that I work for.
But please do not mistake this with an attitude that could be perceived as impudent.

@foxx We've started forcing users to upgrade/change their browsers since i wrote my comment the other day and todays stats show ~4% error rate compared to almost 8% when i wrote the comment. So yes, this will have to do the job, at least for those who know what an upgrade is (and are not still on Win XP)

@papoola I think that even in it's latest iteration, FF on Mac plays mp4 with a flash fallback.

@mmcc
Copy link
Member

mmcc commented Feb 28, 2015

Regarding Firefox, I'm fairly certain as of FF 36 this isn't the case (but I could be wrong). I use FF Developer Edition, and I'm positive that mp4 playback is native at this moment.

@gkatsev
Copy link
Member

gkatsev commented Feb 28, 2015

Firefox should have it in FF36 across all OSes now.

@papoola
Copy link

papoola commented Mar 1, 2015

@omni1000 I do have latest FF on my mac and it does play mp4 natively and partial requests work too.

@githubzhaoqian
Copy link

This function has been support? @papoola @ange007 @heff
I joined

<script src="src/js/media/flash.js"></script>

But there is no response……
Should be how to set up??

<source src="http://www.sptv-1.com/d/file/jingcailanmu/nongguangtiandi/fdcm1h30m.mp4" type='video/mp4' />

<!--<source src="rtmp://www.sptv-1.com:1935/live/sptv1" type="rtmp/flv">     
<source
   src="http://solutions.brightcove.com/jwhisenant/hls/apple/bipbop/bipbopall.m3u8"
   type="application/x-mpegURL">-->
<script> videojs.options.flash.swf = 'node_modules/video.js/dist/video-js/video-js.swf'; // initialize the player var player = videojs('video'); </script>

@ange007
Copy link

ange007 commented Mar 17, 2015

@githubzhaoqian, This functionality isn't accepted yet by developers: #135

@ysksuzuki
Copy link

Any update with PR #135 ? I would really appreciate if the function is supported.
I think it would be getting more difficult to merge it after adding other commits. It worries me.

@yangshenys
Copy link

Since the demo has been finished already about 5 months here #1742, is it in the plan to include this function in the next version? I'm eager to use this to improve the flv file playback experience.

@hubertperron
Copy link

Any news on this issue? I'm now considering switching to JWPlayer because of this limitation...

@foxx
Copy link

foxx commented Jun 25, 2015

Honestly, just switch over. Flash will be dead in a few years time, if not sooner. Anyone still using Flash to play videos needs to upgrade their system, period.

Recommend that this issue is closed/rejected for the sake of humanity.

@ange007
Copy link

ange007 commented Jun 25, 2015

@foxx
You of course forgive me, but the matter is actual for many.
It is important as for business, and is frequent for a large number of users.

@hubertperron
Copy link

My use case involve previewing video files from external sources. Most of them uses HTML5 video compatible format but some of the bigger one stills uses flash. For example, twitch.tv still uses FLV format for lots of their videos. Not being able to seek in a 6h VOD file is just stupid and awful UX.

I know flash should be dead but lots of videos service stills uses FLV format. @foxx, did you looked at this repository name before suggesting dropping support for flash? The goal of this plugin IS to have decent flash support in videoJs.

The thing that bugs me is that @ange007 seems to have a working solution, yet the feature has not been reviewed nor merged in months.

@dave-hansen
Copy link

@hubertperron

The comment thread for #135 contains a number of questions and suggestions by @heff for steps moving forward. These have yet to be addressed or spoken to by the submitter. The code submitted touches some of the most important pieces of the the app. Changes of this scale and severity must be carefully considered. While I'm not involved in maintaining this project, I would not expect this to be merged without analysis by other Flash developers or additions to the test suite.

I also suggest this thread be closed with discussion moving to the Pull Request by @ange007. Perhaps that will encourage more contributions.

@foxx
Copy link

foxx commented Jun 25, 2015

@hubertperron I did indeed look at the repository name, and if you look at the thread history, you'll see I've been commenting on this since 2013. And yes, I am implicitly stating that this project should be terminated for the good of mankind. It has poor performance, security vulnerabilities that will scare even the most seasoned researcher and is not a nice technology to work with. The sooner we all combine forces to get rid of Flash, the quicker it will happen. See Occupy Flash.

I can only hope that the maintainers of VideoJS make a stand and "do the right thing" :)

@mmcc
Copy link
Member

mmcc commented Feb 19, 2016

As I said in the comment on the core repo, we've decided not to pull this in. Huge thanks for the contributions, @ange007 and thank you for the input everyone.

@mmcc mmcc closed this as completed Feb 19, 2016
@foxx
Copy link

foxx commented Feb 19, 2016

Excellent, another nail in the Flash coffin. She'll be dead soon enough...

mjneil added a commit to mjneil/video-js-swf that referenced this issue Nov 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests