Forum Stats

  • 3,769,701 Users
  • 2,253,011 Discussions
  • 7,875,155 Comments

Discussions

Problem with Youtube in WebView

2738702
2738702 Member Posts: 2
edited Aug 28, 2014 3:54AM in JavaFX 2.0 and Later

I'm building app using Javafx Webview, but I have problems with running any Youtube video in Webview.

The strange thing is that rarely it plays ok but more often it shows info "An error occurred, please try again later".

I tried to figure it out, so I made simple app using Youtube iframe API and firebug lite to show where is the problem:

Here is source of Main.java

Here is source of video.html

When I run it on my PC I see the result as below:

yt-error.png

Error state 5 means "The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.".

When I run this video.html file in firefox, chrome, or internal eclipse browser, everything is ok and always work.

I use JRE and JDK 1.8.20 but tried also with older versions, Windows 7 64 bit. I've also installed DivX - did not help. I tried on different PC (also win7 64 bit) and asked 2 people with similar config to run this - and it is not working. As far as I know there is everything ok on Mac.

Where can be the problem with that? Do You have any suggestions?

Answers

  • jsmith
    jsmith Member Posts: 2,856

    I dug up an old small sample app I wrote which played back YouTube HTML5 videos, and none of those videos play back now (they used to work an early Java 7 builds that included JavaFX).  The behaviour when those videos fail is exactly the same as in your image.

      https://gist.github.com/jewelsea/1437374

    I don't know why the videos don't play back correctly anymore, whether there is something that YouTube changed in its API, server infrastructure or playback formats or if there is something changed in JavaFX which makes it now incompatible.

    You could try logging an issue against JavaFX to have a JavaFX developer investigate whatever the issue may be.  I guess you could do the same against the YouTube API in some Google issue tracker, but I don't know how or if Google would follow up on it, you'll probably get a better response (at least for an initial investigation) from the JavaFX developers in this case.

    2738702
  • 2738702
    2738702 Member Posts: 2

    Thanks for reply.

    I've already reported it to Google https://code.google.com/p/gdata-issues/issues/detail?id=6589

    I will report it to Jira too. Yesterday I've tested it on Mac on latest JDK/JRE 1.8.20 and it works perfectly fine which is the most confusing. As far as I know it is a bug related to webview/webkit.

This discussion has been closed.