JavaFX 2.0 :: Playing Youtube Video In WebView

Aug 24, 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:

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 work. 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.

View Replies


ADVERTISEMENT

How To Play YouTube Video In Java Application

May 29, 2014

I am writing a java application that can play youtube video by given URL. first i tried with JPaneleditor, then now i am trying google youtube api, but maybe api is abit too tough for me.

I am using netbeans....

View Replies View Related

JavaFX 2.0 :: HTTP Live Streaming M3u8 Example Not Playing

Jul 15, 2014

I was testing my JavaFX2.2.7 based media player code in a current Java 6 application when I discovered that HTTP Live Streaming does not seem to work.  I can play a local file of the supported format (Sintel trailor mp4 h264) but when I try and use an HTTP Live Stream instead, nothing plays. (for example [URL] ).  I end up with a blank player, and no exceptions or errors.
 
private static final String MEDIA_URL = "http://download.oracle.com/otndocs/products/javafx/JavaRap/prog_index.m3u8";
Media media = new Media(MEDIA_URL);
MediaException ex = media.getError();
if (ex != null){
System.out.println("Media Error" + ex.getMessage());
} else{
System.out.println("No Media Error");
}
 
Program console output: "No Media Error"
 
I thought it was something wrong with my player code, so as a last resort, I went to JavaFX 2 - Ensemble and copied the source and put it directly into my application and ran it... Unfortunately the same result occurs. The player runs, but simply shows a blank video window.  The controls are available, but no video plays.
 
Based on the Release notes for Java 2.2.7 I was under the impression that HLS was supported.  Am I incorrect?
I cannot upgrade to Java 7 as I am firmly stuck with Java 1.6.0.32 due to project constraints.

View Replies View Related

JavaFX 2.0 :: WebView And OpenLayers3

Sep 22, 2014

I'm using WebView to display an OpenLayers3 map, e.g. Animation example from openlayers.org. When I lock my screen and unlock it, none of the openlayers layers are re-drawn. Sometimes bringing the window in to focus or a small resize of the component will cause the map to go blank. This doesn't occur in any browser I've tested, so it seems to be a WebView specific issue, although it also seems to be layer specific and possibly cache related. I've only tested on Windows, 1.7.0_51 x64 and 1.8.0_05 x64 ....

View Replies View Related

JavaFX 2.0 :: Show SVG-Image In WebView

Dec 2, 2014

I would like to reopen the following discussion: Show SVG-Image in WebView (JavaFX 8)
 
In our IDE (Eclipse Luna) running with jdk1.8.0_25 we load a html page into the webengine. The html page contains <img> tags with '.png' and '.svg' as src. Everything looks fine.

But if we execute the programm with java -jar, the WebEngine doesn't display the svg-files. Instead it shows the 'File not find'-Icon. The .png files still work
 
The files are definitly included into the jar and will be displayed if we link to them via <a href="someSvg.svg"></a>
 
So why it doesn't work.

View Replies View Related

JavaFX 2.0 :: Printing WebView Causes NullPointerException

Jun 17, 2014

I tried to print something using the new JavaFX 8 printing logic. Unfortunately, it does not work.
 
System:
Linux Mint 17x64
Oracle JDK 8u5
Default printer is cups pdf
 
Code:

package sample;
import javafx.fxml.FXML;
import javafx.print.PrinterJob;
import javafx.scene.control.TextField;

[Code].....
 
Debugging shows the array MediaPrintableArea[] mpa at J2DPrinter:839 is missing its first element, which causes the exception at line 844.

If I execute

service.getSupportedAttributeValues(MediaPrintableArea.class, null, null)
instead of

service.getSupportedAttributeValues(MediaPrintableArea.class, null, pras)
I get an array with an element on the first position.
 
The msn object used for the PrintRequestAttributeSet is "iso-a4", which causes the missing first element in the MediaPrintableArea[] array.

So why does this happen? Am I missing some important config stuff? I tried to fix it myself, but I am not able to debug service.getSupportedAttributeValues(...).

View Replies View Related

JavaFX 2.0 :: Debugging Connection Timeout In WebView

Nov 4, 2014

I've run in an issue with connection timeout in the WebView. Requesting the URL in a browser will result in an answer, however it may take some time. Running the same request from the WebView results in a connection timeout.

What is the connection timeout for loading a page through the WebView (from issuing the request webEngine.load(url) to the state change failed passes about 40s). The Request in a browser takes about 10s.

Can I manipulate the underlying connection of the WebView (as suggested at java - How to connect to an HTTPS URL from a JavaFX application - Stack Overflow)

Can I set the connection timeout on the WebEngine/WebKit or per request?Is there an issue targeting this?Likewise I would be interested to get a handle on the connection so I can evaluate the header data to retrieve useful information (like response was a PDF which cannot be rendered in the WebView)....

View Replies View Related

JavaFX 2.0 :: How To Handle File Download In WebView

May 6, 2015

I can't find an handler or a listener to intercept the 'Save as' window that should pops up when i click on a download link in a webview embedded page.

View Replies View Related

JavaFX 2.0 :: WebEngine SetAttribute Is Not Reflected In WebView

Sep 6, 2014

I have a WebView which displays a site. At a specific page I want to fill in some values into <input> elements. So i use such an event handler (browser is of WebView class)
       
        browser.addEventHandler(MouseEvent.MOUSE_CLICKED,
                                new EventHandler<MouseEvent>(){
          public void handle(MouseEvent e) {           
            Document doc = webEngine.getDocument();
            if (doc == null) {
              System.out.println("Doc is null");

[Code] ....
 
The handler sets the "value" but view doesn't reflect that, field is empty.

View Replies View Related

JavaFX 2.0 :: Store Cookies Permanently In Webview?

Sep 15, 2014

I am trying to develop a app for facebook and other social networks using webview. When the app is closed all the cookies are removed and when it is relaunched we can't get use of cookies.  I want to know how to store cookies permanently and use them when the browser is relaunched. And I also want to know how to save web history permanently.

View Replies View Related

JavaFX 2.0 :: HTML Rendering With Webview Component

Nov 14, 2014

I have a big issue to render this html page with the webview component :
 
<html><head lang="en">  <meta charset="UTF-8">  <title>Pb Rotate</title>  <style type="text/css">   #myDivRotate {
color: purple;   background-color: #d8da3d;   height: 200px;   width: 300px;   margin-top: 20px;   margin-left:20px;   -webkit-transform:perspective(400px) rotateX(30deg);   -webkit-backface-visibility: visible;   }
   </style></head><body>  <div id="myDivRotate">   Coucou
   </div></body></html>

The problem is from "perspective" in -webkit-transform. Without it's ok. But with this one, the result is different from a standard browser like chrome or safari.

View Replies View Related

JavaFX 2.0 :: Display Image In WebView From External Directory

Jun 18, 2014

I have a WebView and a Javascript that appends an <img> tag in a webview.
 
Like so:
 
function insertImg(src) {
   $("body").append("<img src='" + src + "'/>");
}
 
I call this function with the following code:
 
String path = "file://Users/rod/Desktop/123.gif";
webengine.executeScript("insertImg('" + path + "')");
 
However, this does not work and no image is displayed.
 
How can this be achieved?

View Replies View Related

Music In Java ComboBox Not Playing

May 29, 2014

I am trying to create a program that plays music with a java combo box. For some reason when I hit play the music does not play.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.AudioClip;
import java.net.URL;
public class JukeBoxControls extends JPanel

[Code] .....

View Replies View Related

Applet That Display Images Of Playing Cards?

Aug 18, 2014

So I'm trying to make an applet that displays images of playing cards. The applet should load a deck of 52 playing card images (the folder is called "images"). The applet should shuffle the deck (using a random number generator) and display the first 10 cards of the shuffled deck. I then have to display the cards in two rows of five cards each.

With this code I have about 100 errors and I'm not sure what I'm doing wrong:

import java.util.Random;
import java.awt.Image;
import java.applet.Applet;
import java.awt.Graphics;
public class unit12 extends Applet
{
Image card1, card2, card3, card4, card5, card6, card7, card8, card9, card10;

[Code] ....

View Replies View Related

Playing And Stopping Music File With Same JButton

Oct 8, 2014

This is my whole Code

import java.awt.*;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;

[Code] .....

I'm not getting any errors, just i can't seem to stop the music from playing after clicking the jbutton "Sound On" / "Sound Off" again. I've tried a few methods but it just isn't working for me.

View Replies View Related

Playing And Stopping A Music File With Same JButton

Oct 8, 2014

This is my whole Code

import java.awt.*;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;

[Code] ....

I'm not getting any errors, just i can't seem to stop the music from playing after clicking the jbutton "Sound On" / "Sound Off" again. I've tried a few methods but it just isn't working for me.

View Replies View Related

Applets :: Display Images Of Playing Cards And Shuffle The Deck

Jul 28, 2014

"In this assignment you will use an applet to display images of playing cards. The applet should load a deck of 52 playing card images from the "images" folder that you downloaded. The applet should shuffle the deck (use a random number generator) and display the first 10 cards of the shuffled deck. Display the cards in two rows of five cards each."

That is my goal for this assignment. I've got my code compiling and I will post it below and I've got an html page but when I try to open it I get an error

import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Image;
import java.util.Random;
public class Assignment12 extends Applet {
Image card1;
Image card2;

[Code] ....

View Replies View Related

Second Video Cancels First

Oct 31, 2014

How do I correct this problem… The first video wil cancel out the second one. Can it be stopped?

<script language="Javascript" type="text/javascript">
function reload()
{
setTimeout('reloadImg("refresh")',1000)
};
function reloadImg(id)

[code]....

View Replies View Related

Which Listener To Use On Video Panel

Jun 4, 2014

I have panel = window(new frame) and its used to render a video image on, i need to pickup a touchscreen press change of event but not sure which event listener to use and on which component. Is it a panel, window or frame event? and which listener would detect a focus change or a mouse press

I know mouse listener and focus listener and window listeners are available but not sure they would be able to detect the screen press on the video rendered image...

View Replies View Related

Inserting Video Into Graphics?

Feb 12, 2014

So I'm doing a project for my CS class where we have to create a snowman doing something. My picture is of Vince Young in the 2005 Rose Bowl. I'm trying to make the actual video clip from Youtube (do I need to download it? If so I can do that) appear on the scoreboard, but how.

import java.awt.*;
import java.awt.event.*;
import java.awt.Font.*;
class snowBackground
{
public static void drawField(Graphics g, Color field)

[code]....

There are 3 other files that make the actual Snowmen.Also, would I need to download the mp3 sound file seperately and play that, or will inserting the video do both?

View Replies View Related

Swing/AWT/SWT :: Inserting A Video Into Graphics?

Feb 12, 2014

So I'm doing a project for my CS class where we have to create a snowman doing something. My picture is of Vince Young in the 2005 Rose Bowl. I'm trying to make the actual video clip from Youtube (do I need to download it? If so I can do that) appear on the scoreboard. As of right now, this is my background file:

import java.awt.*;
import java.awt.event.*;
import java.awt.Font.*;
class snowBackground {
public static void drawField(Graphics g, Color field) {
Color sky = new Color(95,166,243);

[Code]...

and this is the Driver file (not sure if this is necessary):

import java.awt.*;
import java.awt.event.*;
import java.awt.Font.*;
public class SnowDriverWSB {
public static void main(String args[]) {
GfxApp gfx = new GfxApp();
gfx.setSize(1000,650);

[Code]...

There are 3 other files that make the actual Snowmen. To do this, I need VERY basic steps, as I'm extremely confused and new to Java. Also, would I need to download the mp3 sound file seperately and play that, or will inserting the video do both?

View Replies View Related

Encrypted Video Chat Program Using JMF

Oct 23, 2014

I am trying to make an encrypted video chat program using JMF. I have successfully written the "video chat" part - which includes getting data from webcam and transmitting it using RTP, but how to get raw data video to encrypt it before it stream between the webcam and the network.

For RTP I am using RTPManager, and for reading from the webcam I am using this code:

DataSource ds;
CaptureDeviceInfo di = null;
StateHelper sh = null;System.out.println("Started Video");
String str1 = "vfw:Logitech USB Video Camera:0";
String str2 = "vfw:Microsoft WDM Image Capture (Win32):0";
String str3 = "vfw:Microsoft WDM Image Capture (Win32):0 : vfw://0";

[Code] .....

I plan on using a stream cipher for encryption, maybe RC4.

View Replies View Related

How To Play Video Into Java Application

Feb 10, 2015

How to insert and play a video or a music background in a java application. Let me explain better... I need to develop a game where sometime I need to show picture, or play videos and also, if is possible, add a music in background... I work with eclipse and I know quite good the main concept of java's language...

View Replies View Related

Video Chat Tool Using Java RMI

Jul 3, 2014

I am stuck in making a C/S video chat program using JAVA RMI technology. I am more familiar with Java RMI.

View Replies View Related

RMI :: Transferring Video - AVI File Getting Corrupted

Apr 2, 2010

I have a code which transfers images using rmi... This code works fine... But if i give a .avi file instead of a .jpeg the file gets transferred to the other machine but it gets corrupt... The size is also the same... Do I have to encode the video ??

View Replies View Related

Create A Program That Display Video In Second Monitor

Mar 12, 2014

create a program that display video in second monitor ....every time i run my code it display the video in first monitor not in second monitor .. Here my path i used

private static String mplayerOptions = "mplayer -noborder -vo fbdev2 -nokeepaspect movies.mpeg";

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved