IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Réseau/Web Python Discussion :

Problème avec QWebView() et contenu Flash


Sujet :

Réseau/Web Python

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Avril 2008
    Messages
    9
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2008
    Messages : 9
    Points : 3
    Points
    3
    Par défaut Problème avec QWebView() et contenu Flash
    Bonjour,

    Je viens ici car je rencontre un gros problème avec le module QWebView() est l'affichage de contenu flash sur mes pages. Lorsque je change ma page qui contient le plugin j'obtient une erreur de segmentation.

    PS: Je suis sur Ubuntu.

    Merci d'avance.

  2. #2
    Expert éminent
    Avatar de tyrtamos
    Homme Profil pro
    Retraité
    Inscrit en
    Décembre 2007
    Messages
    4 466
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2007
    Messages : 4 466
    Points : 9 258
    Points
    9 258
    Billets dans le blog
    6
    Par défaut
    Bonjour,

    Je viens d'essayer mon propre navigateur PyQt4/QWebView sur Ubuntu 11.04.

    J'ai affiché youtube. J'ai changé plusieurs fois et rapidement de vidéo sans attendre leur fin. Effectivement, j'ai obtenu une fois un arrêt brutal du navigateur, mais c'est plutôt rare. La plupart du temps, ça fonctionne très bien.

    Il ne te reste plus qu'à en dire plus si tu veux de l'aide:
    - quelle manip as-tu faite pour déclencher le pb (quel site, etc..)
    - donne un code court mais suffisamment complet pour qu'on puisse l'essayer.
    Un expert est une personne qui a fait toutes les erreurs qui peuvent être faites, dans un domaine étroit... (Niels Bohr)
    Mes recettes python: http://www.jpvweb.com

  3. #3
    Candidat au Club
    Profil pro
    Inscrit en
    Avril 2008
    Messages
    9
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2008
    Messages : 9
    Points : 3
    Points
    3
    Par défaut
    Bonjour,

    Je suis content de voir que le problème ne vient pas de mon code ! Voici le code que j'utilise qui ne déclenche une erreur de segmentation au bout de 3 rachaîchissement de la page youtube.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    #!/usr/bin/python
    # -*- coding: utf-8 -*-
    import sys
    import gobject
    import time
    from PyQt4.QtCore import *
    from PyQt4.QtGui import *
    from PyQt4.QtNetwork import *
    from PyQt4.QtWebKit import QWebPage, QWebView, QWebSettings
    #############################################################################
    class Abort(Exception):
        """classe d'exception créée pour l'arrêt du thread"""
        pass
     
    #############################################################################
    class Propagande(QThread):
        """Thread de téléchargement"""
     
        #========================================================================
        def __init__(self, parent=None):
            super(Propagande,self).__init__(parent)
     
        #========================================================================
        def run(self):
          while(1):
            # Chargement de la page
            self.emit(SIGNAL("loader(PyQt_PyObject)"),"http://www.youtube.com/watch?v=3aR27FLbb04")
    	time.sleep(30)
     
    #############################################################################
    class Window1(QWebView):
     
        #========================================================================
        def __init__(self, parent=None):
            super(Window1,self).__init__(parent)
     
    	Settings = self.settings() 
    	#QNetworkProxy.setApplicationProxy(QNetworkProxy(QNetworkProxy.HttpProxy, "192.168.69.3", 8080))
    	Settings.setAttribute(QWebSettings.JavascriptEnabled, True)
    	Settings.setAttribute(QWebSettings.PluginsEnabled, True)
    	Settings.setAttribute(QWebSettings.AutoLoadImages, True)
     
    	self.prop = Propagande()
     
    	self.connect(self.prop, SIGNAL("loader(PyQt_PyObject)"), self.loader)
    	self.prop.start()
     
     
        #========================================================================
        def loader(self, msg):
     
          url = msg
          self.load(QUrl(url))
          #self.showFullScreen()
        #========================================================================
     
    #############################################################################
    if __name__ == "__main__":
        app = QApplication(sys.argv)
        fen = Window1()
        fen.show()
        sys.exit(app.exec_())
    Merci d'avance.

  4. #4
    Expert éminent
    Avatar de tyrtamos
    Homme Profil pro
    Retraité
    Inscrit en
    Décembre 2007
    Messages
    4 466
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2007
    Messages : 4 466
    Points : 9 258
    Points
    9 258
    Billets dans le blog
    6
    Par défaut
    Bonjour,

    J'ai essayé ton code (je l'ai corrigé: effacer "import qobject", et transformer les tabulations en espaces: il ne faut pas mélanger!).

    Sur Windows, ça marche mais sous Linux (Ubuntu 11.04), j'obtiens la même erreur que toi au bout de 5 ou 6 "reload".

    Voici les messages obtenus en console:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    ** (<unknown>:1916): DEBUG: NP_Initialize
    ** (<unknown>:1916): DEBUG: NP_Initialize succeeded
    ** (<unknown>:1916): DEBUG: NP_Initialize
    ** (<unknown>:1916): DEBUG: NP_Initialize succeeded
    ** (<unknown>:1916): DEBUG: NP_Initialize
    ** (<unknown>:1916): DEBUG: NP_Initialize succeeded
    ** (<unknown>:1916): DEBUG: NP_Initialize
    ** (<unknown>:1916): DEBUG: NP_Initialize succeeded
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_set_back_pixmap: assertion `GDK_IS_WINDOW (window)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' failed
    Application asked to unregister timer 0x74000008 which is not registered in this thread. Fix application.
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance with invalid (NULL) class pointer
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance with invalid (NULL) class pointer
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_set_back_pixmap: assertion `GDK_IS_WINDOW (window)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' failed
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `<invalid>'
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `<invalid>'
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_set_back_pixmap: assertion `GDK_IS_WINDOW (window)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' failed
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_set_back_pixmap: assertion `GDK_IS_WINDOW (window)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' failed
    Application asked to unregister timer 0x7d000008 which is not registered in this thread. Fix application.
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_set_back_pixmap: assertion `GDK_IS_WINDOW (window)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' failed
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_set_back_pixmap: assertion `GDK_IS_WINDOW (window)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' failed
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_set_back_pixmap: assertion `GDK_IS_WINDOW (window)' failed
     
    (<unknown>:1916): Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' failed
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
     
    (<unknown>:1916): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'
     
    (<unknown>:1916): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
    Erreur de segmentation
    Et avec mon propre navigateur PyQt4-QWebView, j'obtiens exactement la même chose . La lecture des messages d'erreurs ne me permet pas de savoir d'où ça vient.

    Quelqu'un d'autre aurait une piste?
    Un expert est une personne qui a fait toutes les erreurs qui peuvent être faites, dans un domaine étroit... (Niels Bohr)
    Mes recettes python: http://www.jpvweb.com

  5. #5
    Candidat au Club
    Profil pro
    Inscrit en
    Avril 2008
    Messages
    9
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2008
    Messages : 9
    Points : 3
    Points
    3
    Par défaut
    Bonjour,

    J'ai également essayé avec gtkmozembed et gtk webkit ça fonctionne un peu plus longtemps mais cela fini quand même par planter au bout d'un certain temps. Je pense vraiment qu'il y a un gros problème avec le plugin flash player !!!

Discussions similaires

  1. [FLASH MX2004] [XMLSocket] Problème avec serveur socket php
    Par cocodunombril dans le forum Flash
    Réponses: 4
    Dernier message: 03/04/2009, 02h10
  2. Problème avec livre d'or flash
    Par julien1906 dans le forum Flash
    Réponses: 11
    Dernier message: 16/11/2006, 14h24
  3. Réponses: 5
    Dernier message: 14/01/2006, 20h30
  4. [FLASH MX 2004] Problème avec loader
    Par Sorento dans le forum Flash
    Réponses: 3
    Dernier message: 06/07/2005, 20h21
  5. [FLASH MX] Problème avec l'objet Date
    Par n_tony dans le forum Flash
    Réponses: 13
    Dernier message: 22/03/2005, 13h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo