Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Problem with Youtube in WebView

2738702Aug 24 2014 — edited Aug 28 2014

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?

Comments

jsmith

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

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.

1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 25 2014
Added on Aug 24 2014
2 comments
3,678 views