Comments (9)
hmm, it seems I'm able to change the rendered "bgcolor"...
so it does something
from freshplayerplugin.
probably an issue with ignoring unrequested stream
from freshplayerplugin.
Ok, got it to work to a point where the last needed hack is this:
diff --git a/src/ppb_url_loader.c b/src/ppb_url_loader.c
index 9690d83..8f930f9 100644
--- a/src/ppb_url_loader.c
+++ b/src/ppb_url_loader.c
@@ -241,10 +241,12 @@ open_temporary_file(void)
{
char *tmpfname;
// TODO: make temp path configurable
- tmpfname = g_strdup_printf("/tmp/FreshStreamXXXXXX");
- int fd = mkstemp(tmpfname);
- unlink(tmpfname);
- g_free(tmpfname);
+// tmpfname = g_strdup_printf("/tmp/FreshStreamXXXXXX");
+// int fd = mkstemp(tmpfname);
+
+ int fd = open("/path/to/actual/file.swf", O_RDONLY);
+// unlink(tmpfname);
+// g_free(tmpfname);
return fd;
}
but as I understand it, freshplayer should try to capture the first unrequested stream and use that in order to behave just like NPAPI flash?
from freshplayerplugin.
freshplayer should try to capture the first unrequested stream and use that in order to behave just like NPAPI flash?
Yes, as far as I remember. When NPAPI Flash instance is created, browser itself initiates a flash movie download. So the first stream plugin gets is the .swf
file. With PPAPI, browser does nothing, and the plugin is requesting a download.
from freshplayerplugin.
ok, I have figured out the issue
there is a race condition, if the NPAPI "browser" doesn't stream the file fast enough (ideally in one call to Write), it seems either freshplayer or flash will give up
from freshplayerplugin.
if I stream the file in one go like this:
FILE *pp;
char buffer[1977354];
pp = fopen(filename,"rb");
int len;
while((len=fread(buffer, 1, sizeof(buffer), pp)) != 0) {
pluginFuncs.writeready(instance, stream);
pluginFuncs.write(instance, stream, 0, len, buffer);
}
fclose(pp);
where 1977354 is the file size, everything works with zero modifications to freshplayer
from freshplayerplugin.
Speaking of file sizes. simple-linux-flash-embed
seems to hardcode file size here: https://github.com/idaunis/simple-linux-flash-embed/blob/b7d6ea436470a87659a5b1e59b54480c0664c303/player.c#L364. Did you try to change 99782
to -1
there? It may be important to have either correct data size there or -1
. Otherwise Flash may decide to stop getting SWF content when it gets 99782 bytes.
from freshplayerplugin.
no difference unfortunately :(
from freshplayerplugin.
Try this patch:
diff --git a/player.c b/player.c
old mode 100755
new mode 100644
index 4925ec0..8690aa4
--- a/player.c
+++ b/player.c
@@ -226,7 +226,7 @@ switch (variable) {
*((int*)ret_value)= NPNVGtk2;
break;
case NPNVnetscapeWindow:
- *((int*)ret_value)= PR_TRUE;
+ *((int*)ret_value)= None;
break;
default:
*((int*)ret_value)=PR_FALSE;
@@ -360,9 +360,9 @@ static NPWindow * npwindow_construct (GtkWidget *widget) {
static NPStream * npstream_construct() {
NPStream *stream = (NPStream *) malloc(sizeof(NPStream));
- stream->url=strdup(URL);
+ stream->url=strdup("http://127.0.0.1/movie.swf");
stream->ndata = 0;
- stream->end = 99782;
+ stream->end = 0;
stream->lastmodified= 1201822722;
stream->notifyData = 0x00000000;
stream->headers = NULL;
@@ -908,9 +908,11 @@ int main(int argc, char **argv)
char buffer[8192];
pp = fopen(argv[1],"rb");
int len;
+ int offset = 0;
while((len=fread(buffer, 1, sizeof(buffer), pp)) != 0) {
pluginFuncs.writeready(instance, stream);
- pluginFuncs.write(instance, stream, 0, len, buffer);
+ pluginFuncs.write(instance, stream, offset, len, buffer);
+ offset += len;
}
fclose(pp);
The only essential part are: url
being URL, and correct values of offset
. Looks like NPAPI Flash ignored offsets, but I for some reason decided that if there is a parameter, I must honor it. I don't know for sure why URL matters, but it's something inside PPAPI Flash itself. If ->url
is not an URL, it just doesn't try to load a movie.
stream->end
doesn't seem to change anything, but freshplayerplugin converts 0
to -1
, which is what in PPAPI "language" means that size is not known in advance.
NPNVnetscapeWindow
is not really required too, but plugin expects there a browser window handle, not a boolean. Setting it to None
prevents BadWindow
errors (code 3).
from freshplayerplugin.
Related Issues (20)
- drm test works with intel but not Nvidia HOT 4
- 32 bit build error HOT 2
- [firefox] "[fresh] [error] n2p_call_ptac, NPN_Invoke failed (or there were no npp)" HOT 6
- Some webcams return green screen HOT 1
- Build failure HOT 5
- Missing include for sys/ioctl.h in src/ppb_video_capture.c HOT 1
- (question): use with other browsers still limited to the NPAPI? HOT 9
- using Chromebook flash for desktop Chrome HOT 2
- Fullscreen showing very small window HOT 5
- Chromebook's flash used by firefox works on test but fails in real life HOT 9
- freshwrapper crashing with Firefox 61 and ChromeOS's Flash HOT 2
- Is v0.3.10 production-ready? HOT 1
- asoundlib.h: No such file or directory HOT 4
- Wayland support? HOT 1
- Trouble on XWayland
- FreshPlugin as browser extension HOT 1
- libfreshplayer does not show up in Firefox 69.0.1 64bit HOT 9
- Does freshplayerplugin can be used a plugin on chromium[version:69] HOT 19
- Error when using make HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freshplayerplugin.