Streaming video in QWebView

1,153 views
Skip to first unread message

johan Borgström

unread,
Nov 13, 2013, 10:47:30 AM11/13/13
to python_in...@googlegroups.com
Hello!

I am trying to display a videostream in a QWebView. But The video will not play. As I understand I need to enable some settings to use the hardware acceleration and or some HTML5 features. Have anyone got a snippet on how to embed streaming video?

Best Regards,
Johan

from PySide.QtCore import QUrl

from PySide.QtWebKit import QWebView


class Browser(QWebView):


    def __init__(self):

       QWebView.__init__(self)

       self.loadFinished.connect(self._result_available)



    def _result_available(self, ok):

       frame = self.page().mainFrame()


view = Browser()

view.load(QUrl('http://vimeo.com/61790668'))

view.show()



Justin Israel

unread,
Nov 15, 2013, 8:11:20 PM11/15/13
to python_in...@googlegroups.com
I think you have to tell it to load plugins:

class Browser(QWebView):

    def __init__(self):
        QWebView.__init__(self)
        self.loadFinished.connect(self._result_available)

        settings = self.settings()
        settings.setAttribute(settings.PluginsEnabled, True)

Works for me when I add that.



--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/96c1508a-d4a9-4966-9584-e3188f101036%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

florian...@adnda.com

unread,
Jan 6, 2014, 10:31:23 AM1/6/14
to python_in...@googlegroups.com
Hello,

I wanted to find some information about QWebView and so I found this topic.
I simply want to have google page inside my maya 2012 x64.

I installed this version of PySide http://technically3d.blogspot.fr/2012/05/pyside-x64-471-for-maya-2012.html

And this version of PyQt http://nathanhorne.com/?p=451

However when I tried your code I already have a error on this line "from PySide.QtWebKit import QWebView"

Python answer me with this error

# Error: Error in maya.utils._guiExceptHook:
# File "C:\Program Files\Autodesk\Maya2012\Python\lib\site-packages\maya\utils.py", line 282, in formatGuiException
# exceptionMsg = unicode(exceptionObject.args[0])
# UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 24: ordinal not in range(128)
#
# Original exception was:
# Traceback (most recent call last):
# File "<maya console>", line 3, in <module>
# ImportError: DLL load failed: La procédure spécifiée est introuvable. #

I also tried "from PyQt4.QtWebKit import*"
And I have this answer

# Error: Error in maya.utils._guiExceptHook:
# File "C:\Program Files\Autodesk\Maya2012\Python\lib\site-packages\maya\utils.py", line 282, in formatGuiException
# exceptionMsg = unicode(exceptionObject.args[0])
# UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 24: ordinal not in range(128)
#
# Original exception was:
# Traceback (most recent call last):
# File "<maya console>", line 2, in <module>
# ImportError: DLL load failed: La procédure spécifiée est introuvable. #

What does that mean ?

Ævar Guðmundsson

unread,
Jan 6, 2014, 2:36:23 PM1/6/14
to python_in...@googlegroups.com, florian...@adnda.com


On Monday, January 6, 2014 3:31:23 PM UTC, florian...@adnda.com wrote:
I simply want to have google page inside my maya 2012 x64.


Justin Israel

unread,
Jan 6, 2014, 10:37:41 PM1/6/14
to python_in...@googlegroups.com

It appears that Maya is failing to report an exception being raised by the import. The original exception is saying something about the DLL for your Qt lib not being right. Then Maya tried to format the message for the script editor and fails.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

florian...@adnda.com

unread,
Jan 7, 2014, 3:37:05 AM1/7/14
to python_in...@googlegroups.com
That's strange, I'm not 100% sure that PySide works correctly on my computer.
However I have no problem to run QT code except for this :"from PyQt4.QtWebKit import*"
I will try to reinstall pyside

Justin Israel

unread,
Jan 7, 2014, 3:58:19 AM1/7/14
to python_in...@googlegroups.com
With those pre-built installers people have made, they would have needed to build all of the Qt modules. Its possible you are using a build that doesn't include being built against QtWebKit


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

houm...@gmail.com

unread,
Aug 19, 2014, 12:54:33 AM8/19/14
to python_in...@googlegroups.com, florian...@adnda.com
Reply all
Reply to author
Forward
0 new messages