~ubuntu-branches/ubuntu/quantal/gecko-mediaplayer/quantal

« back to all changes in this revision

Viewing changes to src/plugin_setup.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Tirabassi
  • Date: 2010-02-27 17:04:42 UTC
  • mfrom: (1.1.16 upstream) (0.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20100227170442-vunev0niu3xmrij8
Tags: 0.9.9.2-1
* Point fix release (LP: #523793):
  - Use proper NPERR and NPRES codes in the URLNotify and DestroyStream
  - Fix Apple HD Gallery site
  - Improved handling of .m3u playlists
  - Opera still has issues with apple.com/trailers sites,
    due to user agent issues.
* Add chromium-browser (>> 4.0) as a compatible browser

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
 
65
65
    if (instance->mode == NP_EMBED) {
66
66
        for (i = 0; i < argc; i++) {
67
 
        
 
67
 
68
68
            if (argn[i] == NULL)
69
69
                continue;
70
 
                
 
70
 
71
71
            printf("ARG: %s = %s\n", argn[i], argv[i]);
72
72
 
73
73
            if (g_ascii_strcasecmp(argn[i], "name") == 0) {
109
109
                sscanf(argv[i], "%i", &height);
110
110
            }
111
111
 
112
 
            if (g_ascii_strcasecmp(argn[i], "src") == 0
113
 
                || g_ascii_strcasecmp(argn[i], "url") == 0) {
 
112
            if (g_ascii_strcasecmp(argn[i], "src") == 0 || g_ascii_strcasecmp(argn[i], "url") == 0) {
114
113
                item = g_new0(ListItem, 1);
115
 
                if (g_strrstr(argv[i],"XXmovies.apple.com")) {  // tmp disabled, to reenable remove XX
 
114
                if (g_strrstr(argv[i], "XXmovies.apple.com")) { // tmp disabled, to reenable remove XX
116
115
                    tmp = g_strrstr(argv[i], "movies.");
117
116
                    if (tmp != NULL && strlen(tmp) > strlen("movies.")) {
118
 
                        tmp = tmp + strlen("movies.");    
119
 
                        g_snprintf(item->src, 4096, "http://www.%s", tmp);  
 
117
                        tmp = tmp + strlen("movies.");
 
118
                        g_snprintf(item->src, 4096, "http://www.%s", tmp);
120
119
                    } else {
121
120
                        g_strlcpy(item->src, argv[i], 4096);
122
 
                    }               
 
121
                    }
123
122
                } else {
124
123
                    g_strlcpy(item->src, argv[i], 4096);
125
124
                }
144
143
 
145
144
            if (g_ascii_strcasecmp(argn[i], "href") == 0) {
146
145
                item = g_new0(ListItem, 1);
147
 
                if (g_strrstr(argv[i],"XXmovies.apple.com")) {
 
146
                if (g_strrstr(argv[i], "XXmovies.apple.com")) {
148
147
                    tmp = g_strrstr(argv[i], "movies.");
149
148
                    if (tmp != NULL && strlen(tmp) > strlen("movies.")) {
150
 
                        tmp = tmp + strlen("movies.");    
151
 
                        g_snprintf(item->src, 4096, "http://www.%s", tmp);  
 
149
                        tmp = tmp + strlen("movies.");
 
150
                        g_snprintf(item->src, 4096, "http://www.%s", tmp);
152
151
                    } else {
153
152
                        g_strlcpy(item->src, argv[i], 4096);
154
 
                    }               
 
153
                    }
155
154
                } else {
156
155
                    g_strlcpy(item->src, argv[i], 4096);
157
156
                }
195
194
                if (g_ascii_strcasecmp(argv[i], "quicktimeplayer") == 0) {
196
195
                    newwindow = TRUE;
197
196
                } else {
198
 
                        item = g_new0(ListItem, 1);
199
 
                        g_strlcpy(item->src, argv[i], 4096);
200
 
                        // printf("Item href = %s\n",item->src);
201
 
                        item->streaming = streaming(item->src);
202
 
                        item->play = FALSE;
203
 
                        item->id = instance->nextid++;
204
 
                        instance->playlist = g_list_append(instance->playlist, item);
205
 
                        src = item;
206
 
                        instance->show_controls = 0;
207
 
                }
 
197
                    item = g_new0(ListItem, 1);
 
198
                    g_strlcpy(item->src, argv[i], 4096);
 
199
                    // printf("Item href = %s\n",item->src);
 
200
                    item->streaming = streaming(item->src);
 
201
                    item->play = FALSE;
 
202
                    item->id = instance->nextid++;
 
203
                    instance->playlist = g_list_append(instance->playlist, item);
 
204
                    src = item;
 
205
                    instance->show_controls = 0;
 
206
                }
208
207
 
209
208
            }
210
209
 
248
247
                    autohref = FALSE;
249
248
                }
250
249
            }
251
 
            
252
 
            if (g_ascii_strcasecmp(argn[i], "data") == 0) {
 
250
 
 
251
            if (g_ascii_strcasecmp(argn[i], "data") == 0) {
253
252
                // autohref = TRUE;
254
253
            }
255
254
 
385
384
                    || g_ascii_strcasecmp(argv[i], "yes") == 0
386
385
                    || g_ascii_strcasecmp(argv[i], "1") == 0) {
387
386
                    instance->debug = TRUE;
388
 
                                                   
 
387
 
389
388
                } else {
390
389
                    instance->debug = FALSE;
391
390
                }
401
400
                }
402
401
            }
403
402
 
404
 
            if (g_ascii_strncasecmp(argn[i], "qtnext",6) == 0) {
405
 
                parse = g_strsplit_set(argv[i],"<>",0);
 
403
            if (g_ascii_strncasecmp(argn[i], "qtnext", 6) == 0) {
 
404
                parse = g_strsplit_set(argv[i], "<>", 0);
406
405
                if (parse[1] != NULL) {
407
406
                    item = g_new0(ListItem, 1);
408
407
                    tmp = g_strrstr(src->src, "/");
418
417
                    item->play = TRUE;
419
418
                    item->id = instance->nextid++;
420
419
                    instance->playlist = g_list_append(instance->playlist, item);
421
 
                }        
 
420
                }
422
421
                g_strfreev(parse);
423
422
            }
424
423
 
427
426
 
428
427
    }
429
428
 
430
 
    nperror =
431
 
        NPN_GetValue(instance->mInstance, (NPNVariable) 17 /* NPNVSupportsWindowless */ ,
432
 
                     &supportsWindowless);
 
429
    nperror = NPN_GetValue(instance->mInstance, (NPNVariable) 17 /* NPNVSupportsWindowless */ ,
 
430
                           &supportsWindowless);
433
431
    supportsWindowless = (nperror == NPERR_NO_ERROR) && supportsWindowless;
434
432
    if (instance->windowless) {
435
433
        if (supportsWindowless) {
452
450
    if (href != NULL && src != NULL) {
453
451
        src->hrefid = href->id;
454
452
    }
455
 
        
456
453
    // if target is set, set it on the href
457
454
    if (href != NULL) {
458
455
        href->newwindow = newwindow;