Qt5 introduced QMediaPlayer
but it can't play youtube link (I want only music). What I found is that in Qt 4.8 (phonon) it could but in Qt5 I get error:
Missing decoder for 'text/html'. GStreamer has no plugin for it
It is pure translation from Polish output in Qt creator. Is it a matter of GStreamer plugin or should I download HTML content, find direct link to media and play it? Any idea?
Code:
mMediaPlayer.setMedia(QUrl("http://youtu.be/wVvoQIdD80U"));
mMediaPlayer.play();
Link to youtube video is link to web page, that contain link to media. First off all you need to extract this URL from web page than handle this URL.
You may look, how to do this in Qt-YouTube project on GitHub.