Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8107504

Referencing a video with {__DIR__} results in a MediaUnsupportedException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • fx2.0
    • fx1.0
    • javafx
    • Version 1.1

      When referencing a video URL by means of the {__DIR__} notation, the application crashes with the following stracktrace:

      FX Media Object caught Exception com.sun.media.jmc.MediaUnsupportedException: Unsupported media: jar:file:/C:/Development/netbeans_workspace/MobileTest/dist/MobileTest.jar!/mobiletest/demo.3gp
          source ='jar:file:/C:/Development/netbeans_workspace/MobileTest/dist/MobileTest.jar!/mobiletest/demo.3gp'
      com.sun.media.jmc.MediaUnsupportedException: Unsupported media: jar:file:/C:/Development/netbeans_workspace/MobileTest/dist/MobileTest.jar!/mobiletest/demo.3gp
              at com.sun.media.jmcimpl.PeerManager$1.run(PeerManager.java:58)
              at java.security.AccessController.doPrivileged(Native Method)
              at com.sun.media.jmcimpl.PeerManager.throwMediaException(PeerManager.java:51)
              at com.sun.media.jmcimpl.PeerManager.getMediaPeer(PeerManager.java:211)
              at com.sun.media.jmc.Media.<init>(Media.java:50)
              at javafx.scene.media.Media$1.onChange(Media.fx:88)
              at javafx.scene.media.Media$1.onChange(Media.fx:81)
              at com.sun.javafx.runtime.location.ObjectVariable$2.onAction(ObjectVariable.java:162)
              at com.sun.javafx.runtime.location.ObjectVariable$2.onAction(ObjectVariable.java:159)
              at com.sun.javafx.runtime.location.DependencyIterator.action(AbstractLocation.java:503)
              at com.sun.javafx.runtime.location.DependencyIterator.action(AbstractLocation.java:491)
              at com.sun.javafx.runtime.util.Linkables.iterate(Linkables.java:82)
              at com.sun.javafx.runtime.location.AbstractLocation.iterateChildren(AbstractLocation.java:282)
              at com.sun.javafx.runtime.location.ObjectVariable.notifyListeners(ObjectVariable.java:159)
              at com.sun.javafx.runtime.location.ObjectVariable.replaceValue(ObjectVariable.java:114)
              at com.sun.javafx.runtime.location.ObjectVariable.set(ObjectVariable.java:125)
              at com.sun.javafx.runtime.location.AbstractVariable$4.apply(AbstractVariable.java:132)
              at com.sun.javafx.runtime.location.AbstractVariable.needDefault(AbstractVariable.java:151)
              at javafx.scene.media.Media.initialize$(Media.fx:81)
              at mobiletest.VideoDIRBug.javafx$run$(VideoDIRBug.fx:21)
              at mobiletest.VideoDIRBug.javafx$run$(VideoDIRBug.fx:21)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at com.sun.javafx.runtime.provider.AWT_EDT_RuntimeProvider$1.run(AWT_EDT_RuntimeProvider.java:104)
              at java.awt.event.InvocationEvent.dispatch(Unknown Source)
              at java.awt.EventQueue.dispatchEvent(Unknown Source)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
              at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
              at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
              at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
              at java.awt.EventDispatchThread.run(Unknown Source)


      Here's the snippet that provokes the error:

      import javafx.scene.Group;
      import javafx.scene.media.Media;
      import javafx.scene.media.MediaPlayer;
      import javafx.scene.media.MediaView;
      import javafx.scene.Scene;
      import javafx.stage.Stage;

      Stage {
          width: 250
          height: 250
          scene: Scene {
              content: Group {
                  content: [
                      MediaView {
                          fitWidth: 150
                          fitHeight: 150
                          mediaPlayer: MediaPlayer {
                              autoPlay: true
                              media: Media {
                                  source: "{__DIR__}demo.3gp"
                                  //source: "file:///C:/development/netbeans_workspace/MobileTest/src/mobiletest/demo.3gp"
                              }
                          }
                      }
                  ]
              }
          }
      }

            bpb Brian Burkhalter
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: