MediaPlay to play media from an InputStream

I think there is a compelling use case that needs the MediaPlayer to play media from an InputStream instead of the protocols such as http, file, and jar which are supported by JavaFx right now.
If your JavaFX runs inside your browser and if you generate some audio on the fly and put it in a byte array in your local memory, there is no way you can play it. None of the available workarounds are elegant. If you attempt to save that audio into a file temporarily and intend to play it from the file, you would need to trouble your users with the security permission pop-up. If you create a webserver programmatically on the client machine, you would also need to ask the users for socket permission. If you try to save the audio into the javafx.io.Storage, you cannot access it as a java.io.File object, thus you cannot use the file:/// protocol anymore. Well, you could send the audio to a remote webserver somewhere and read it back through http, that works but it is plainly silly.
Above all, if the InputStream is supported by MediaPlayer, all other three (http, file, jar) would be automatically taken care of because all those three can be converted to an InputStream one way or another,
Also, before an InputStream hits the MediaPlayer, you can process it any way you want. For example, you could place an Ogg Vorbis encoder/decoder along the pipeline between the MediaPlayer and the media source. Then I believe the Ogg Vorbis issue will be resolved automatically.

I think that is not possible indeed. You can handle InputStream as well saving as a file and read that file long after save it. So the Media from MediaPlayer can read a file using source attribute.
But I agree with you. The possibilities to handle InputStream directly is more interesting, you can read from a internal file added in jar, can read from a Socket connection without the necessity to save to a file. You can read directly from a database record, so, that resource is more flexible
I think JavaFX media support aim is focused to read local resources unfortunately.

Similar Messages

  • My AppleTV 2 when I want to play media from iTunes 10.5 and my AppleTV also has up to date firmware Keeps dropping my "Home Sharing" connection while all other media sources YouTube,Netflix...etc still work?

    My AppleTV 2 when I want to play media from my WinVistaPC 64bit iTunes 10.5 and my AppleTV also has up to date firmware when trying to play media from the "Computer" tab on the AppleTV my  PC and all of the media be it music ,movies or podcasts it tries to load  the spinning thing on the middle of the screen never loads then my PC disappears from the AppleTV and says "From your computer in iTunes login to Home Sharing with your AppleID " so I do that and IT STARTS WORKING! BUT! then after the media finishes playing it regresses back to the same problem and I have reinstalled iTunes and it doesnt resolve anything it says under the advanced tab of iTunes 10.5 that "Home Sharing is ON!" and I have to click "Turn off Home Sharing" then re enter my password again and restart the entire process only to have it let me play 1 media file of any Apple formatted files once it ends its back to the drawing board? Thankyou in advance for any knowledge you may share
    Samuel

    My AppleTV 2 when I want to play media from my WinVistaPC 64bit iTunes 10.5 and my AppleTV also has up to date firmware when trying to play media from the "Computer" tab on the AppleTV my  PC and all of the media be it music ,movies or podcasts it tries to load  the spinning thing on the middle of the screen never loads then my PC disappears from the AppleTV and says "From your computer in iTunes login to Home Sharing with your AppleID " so I do that and IT STARTS WORKING! BUT! then after the media finishes playing it regresses back to the same problem and I have reinstalled iTunes and it doesnt resolve anything it says under the advanced tab of iTunes 10.5 that "Home Sharing is ON!" and I have to click "Turn off Home Sharing" then re enter my password again and restart the entire process only to have it let me play 1 media file of any Apple formatted files once it ends its back to the drawing board? Thankyou in advance for any knowledge you may share
    Samuel

  • HT1595 I have 2 Apple TV's one the oldest works fine the 2nd one refuses to recognise the MacBook Pro its connected to but I can play media from the MacBook on the Apple TV from iTunes, help?

    I have 2 Apple TV's one the oldest works fine the 2nd one refuses to recognise the MacBook Pro its connected to but I can play media from the MacBook on the Apple TV from iTunes, help?

    Sorry, content bought with one Apple ID cannot be merged or transferred to another Apple ID.

  • How do I play media from a cloud storage drive on mac?

    I have all my media stored on MEGA, cloud drive (https://mega.co.nz) I would like to play it on a media player? (like XBMC)?
    please a step by step answer, Can I play the media from the cloud drive or do I need to download it off the cloud first? is the cloud drive only for storage? you would think I should be able to play my media from the cloud drive (THANK YOU)

    I use OneDrive and Amazon Cloud services and they vary but are able - with Amazon it downloads a copy to local device it seems before playing - or queues enough to avoid stuttering.
    What happens when you try though that you asked first, or tried and failed.

  • ITunes cannot play media from alternate hard drive.

    Out of nowhere one day my iTunes (Windows 7) stopped playing my music. I could double click on a song and iTunes would freeze up for a minute, then just unfreeze (No error message or anything). With more research I found out that the only songs that wont play are those on a different hard drive in my computer (M:\). These songs have always been on this drive, and I've never had a problem before. If I move the songs to my C:\ drive, they will play in iTunes fine. The songs play fine from their M:\ location in other media players.
    One of the weirdest parts is if I reset the library and try to re-add these songs, sometimes they wont add at all and other times they will add but not retain any meta information like Title, Artist, Album, etc; it will only display the file name. They still do not play in this state.
    I've tried:
    Reinstalling iTunes
    Removing Library files
    Re-adding songs to library
    Booting iTunes in safe mode
    Clearing iTunes cache
    Running in compatibility mode
    Made sure iTunes is up to date
    Other things that I probably don't remember (I've been trying for a while)

    I'm a bit upset, too. It's only deleted one song, but why did that random song go, and when will it happen to 100s of them?
    I have the song on CD and can re-rip it, but that's not the point - it shouldn't go missing from the hard drive.
    I've aleady resigned myself to backing up the ITL library file on a regular basis in case it gets mysteriously corrupted.
    I'm not sure iTunes deleted this song, but it sure is suspicious.

  • Playing media from iPhone's library on the PC.

    My little bro recently showed me how to access and listen to media from his iPod's library while plugged into my computer's usb. I can't seem to do that with my iPhone's library. The library shows up while connected, but remains shaded in light gray and will not allow me to play any of the songs listed in iPhone's library on my pc. Is there something I'm missing? How do I play these songs on my PC while connected to iPhone?

    Click here, follow the instructions, and try again.
    (35557)

  • Play Media from memory, like a byte[]

    Hi,
    I'm using three media classes in tandem to stream and play a media file locally as shown below. The problem is my file is encrypted for security (in addition to normal encoding like avi). If it isn't encrypted, I can easily stream it. When it is encrypted I have to decrypt to a temp directory first, but this defeats the security.
    Is there any way to decrypt the Media as it streams?
    Alternatively, is there a way to play it completely from memory?
    I was able to do something similar with the ImageView class by creating an Image object from a BufferedImage via the toFXImage function of the SwingUtils package which allowed me to show the Image from memory. Anything similar for video?
        var media : Media = Media {
            source: filePath
        var player : MediaPlayer = MediaPlayer {
            media: media,
            autoPlay: true
        var box : MediaView = MediaView {
            mediaPlayer: player
        }

    I am also interested in be able to do something like this. Bump.

  • AppleTV is not playing media from iTunes

    I have a 500GB+ iTunes library on a FireWire external. I have always been able to pull up my TV Shows, Movies etc from either of my AppleTVs. I have a 2nd Gen in my living room and a 3rd Gen in my bedroom.
    Suddenly, over a week ago, both decided that they did not want to play any of my videos from iTunes any more.
    I can navigate to Computers, select either Movies or TV Shows, navigate the full list in either... but when you press play, you get this...
    The TV will sit and spin for hours upon hours.
    Here is what I have done to try to resolve this issue...
    Restored both AppleTVs to factory settings, updated to the latest available OS.
    Logged out of Home Sharing on my iMac and back in.
    Moved my AppleTVs to 5GHz WiFi
    Rebooted my iMac
    Does anyone have any suggestions? I'm going mad!

    I have a very similar issue with a comparable time frame.  Mine eventually tells me that the computer is not authorized, although it is.  I can still watch content streaming from Apple's servers, but not streaming from my hard drive.  I'm on a Windows computer hosting the library, and had issues with jerky video for a week prior to this new issue.  I have rebooted the computer multiple times to no avail, and have even tried running iTunes with an administrator account.

  • Front Row: playing media from NAS

    Dear Community Members,
    I use NAS (WD ShareSpace) and plan to transfer my Movies, Pictures and Music libraries to a share on the NAS.
    As far as I understand, Front Row can easily hadle Movies folder because it actually reads folder contents.
    Can you share any experience of playing iTunes playlists and iPhoto events stored on a NAS from within Front Row please?

    quit itunes and copy your itunes library to the NAS and delete the original. then make an alias to the the new itunes library in the original location in your Music folder. this should work both with itunes and Front Row. but make sure the NAS is mounted at all times when you try to use itunes or Front Row.

  • How to play media form InputStream with jmf or dsj?

    the media format is avi or mp4.
    media receive from socket and put in a ring buffer.now implement InputStream to read datas from buffer and play the data.
    i want to know how to play media from inputStream

    Hi, thanks for replying.
    Im not exacly sure what year the imac is i cant seem to find it anywhere.
    I bought the machine last year on apples refurbished site. Someone at Apple support suggested once that it maybe a 2010 model. In system profiler there is a thunderbolt tab in the left hand pane but it says there are no drivers  loaded. Does that mean that thunderbolt is on the mac but i must install the drivers? If so, is it all plug and play after that or do i need to configure it all manually? If so coyuld you please point me in the right direction for instructions on how to do it. My tv for instance is saying that it cant find a server. As for vlc player, i use it all the time.Dont know what ide do without it !

  • Play video from input stream

    urgent
    i need to play an mpg file from a jar file but the Manager.createPlayer now only Url object
    is there any other way to play video from InputStream?

    You may want to take a look at this:
    http://www.extollit.com/isdsjmf.php
    I developed a similar implementation of this for a client and it works fine. It's based on using a sequential InputStream as a DataSource for the media player. As you may already know, the Java Media Framework does not seem to support URLDataSource and/or sequential InputStreams.
    This code allows you to play media from nothing more than an InputStream without downloading it all into memory or to a local file. It uses a ringbuffer as a compromise along with some other enhancements.

  • Play a video from an InputStream

    Hi!
    Is it possible to load a video in JavaFX from an InputStream? I want to implement a video player with JavaFX that can play an encrypted video received from the network. I have noticed that it is not possible to do this using the classes MediaPlayer (javafx.scene.media.MediaPlayer) or MediaComponent (com.sun.fxmediacomponent.MediaComponent), and I have read that this version does not support JafaFX video encoding. The question is the following: is it possible to load a video from a Stream that has been previously tried manually, although it would be necessary to download it whole before playing it?
    Thank you

    You could probably use an SSLSocket to read the video file from an encrypted stream, save it as a file on the client machine, and then read the video from the file to the MediaPlayer if that's what you mean.

  • Playing media files from Time Capsule hard drive

    Hello folks,
    I am using my 3TB Time Capsule to host all of my video files, most of which are MKV files. I also have an external hard drive connected to the USB port on Time Capsule and there are few video files on it as well.
    I am using Time Capsule as a router sitting between the cable modem (WAN) and my locan network (LAN). I have an Argosy HV355T digital media player hooked up to my home theater and TV via HDMI. It is connected to Time Capsule via Ethernet.
    On Argosy media player, I am able to connect to Time Capsule (login is successful) but I can neither see the hard drives nor their contents.
    When I connect the external hard drive to the USB port on Argosy, the hard drive is recognized and files from it can be read and played. Thus I have ruled out the possibility of Argosy being unable to read Mac formats.
    I try to use uPnP on Argosy to connect as uPnP client to Time Capsule, but nothing happens. I thought uPnP is turned ON by default on Time Capsule.
    Why am I not able to see the Time Capsule hard drive from my media player?
    What am I missing in my setup?
    Do I need to install a media server device to read files from hard drives and storage, and stream to media player (Argosy)?
    How are you folks using Time Capsule to play video from its hard drive on to TV?
    Thanks.

    I try to use uPnP on Argosy to connect as uPnP client to Time Capsule, but nothing happens. I thought uPnP is turned ON by default on Time Capsule.
    Why am I not able to see the Time Capsule hard drive from my media player?
    What am I missing in my setup?
    Do I need to install a media server device to read files from hard drives and storage, and stream to media player (Argosy)?
    How are you folks using Time Capsule to play video from its hard drive on to TV?
    The TC has no upnp.. no Apple device does.. Apple refused to join and went off in a huff, sat in the corner and created their own.. NAT-PMP.. which as you can imagine.. doesn't work with anything else but Apple stuff.
    So first issue.. no upnp but that isn't a biggie.
    SMB file protocol which the rest of the world uses.. has rules which Apple also breaks.
    Make sure your TC is setup with all short names. no spaces and pure alphanumeric.
    On the file sharing page of the airport utility.. (you may need to use 5.6 from Mac or Windows), ensure that you set a workgroup.. generally now WORKGROUP. And make sure you turn on the guest account to full read and write permissions.
    It would be good to ensure a normal windows computer can access the TC..
    In windows explorer type in the address bar
    \\TCname or \\TCIPaddress (where you replace with actual name or IP).
    I do not know the Argosy player but I will look it up.
    My hacked ATV1 can see and play files from the TC. That is running XMBC of course.

  • There are error message "No such interface supported" when play Audio/Media from USB thumb disk with Metro APP like Xbox.

     There are error message "No such interface supported" when play Audio/Media from USB thumb disk with Metro APP like Xbox in windows. how can I solve this problem?   if I use destop player like windows media player, no such error.
    would you please give some solution for this error? thanks!

    OS is window10, Metro APP is Xbox or MultiMedia 8; any video format will occur error only by following steps:  
    a. Put Audio / Media / Photo files into USB thumb disk or Micro SD card.
    b. Connect USB thumb disk / Micro SD Card  to Platform.
    c. Open 'File Explorer', click USB thumb disk.
    d. Open audio file with metro app: Music. / Open Media file with metro app: Video./Open Photo file with metro app.

  • N8 Unable to play media clip from micro SD

    Hi All,
    I've seen this about a couple of places but there don't seem to be any solutions out there.
    I've got a 32gb micro SD card in the N8. Everything seemed fine to start with, but after the first 3 videos I watched now if I try to play videos off the SD I get "Unable to play media clip". Sometimes if I remove the file and then copy it back over to the card it works, but obviously this is quite frustrating.
    If I copy these files to the phone's internal memory then they play fine.
    I would appreciate it if anyone has got any ideas on this.
    Cheers,
    Stephen

    drfeilij wrote:
    Dear Stephen
    i had the same problem.
    i've bought a 32GB microSDHC Kingston, and i realized dat no movie could have been played...not even videos taken by the mighty Nokia N8.
    i formatted it inside of N8...and on my PC but nothing worked really.
    Then....i found the solution, and it's working like a chaaaaaaaaaaaarm.
    on Windows 7...right click on My Computer..Manage...Disk Management...then choose the memory card from there and format it using FAT32 , quick format and  Allocation Unit Sizeas 16kilobytes! dont choose default nor 32kilobytes! ok?
    then the process of formatting will begin and it will take around...2 hours! yes 2 damn long interminable hours formatting ur memory card...once finish....u can enjoy having a powerful 32gb microsd on the mighty marvelous Nokia N8.
    PS: if u want to fromat by right clicking on the memory card and chooseing format...it wont work. u gotta pass through disk management processing.
    good luck
    waiting for ur feedback!
    drfeilij wrote:
    Dear Stephen
    i had the same problem.
    i've bought a 32GB microSDHC Kingston, and i realized dat no movie could have been played...not even videos taken by the mighty Nokia N8.
    i formatted it inside of N8...and on my PC but nothing worked really.
    Then....i found the solution, and it's working like a chaaaaaaaaaaaarm.
    on Windows 7...right click on My Computer..Manage...Disk Management...then choose the memory card from there and format it using FAT32 , quick format and  Allocation Unit Sizeas 16kilobytes! dont choose default nor 32kilobytes! ok?
    then the process of formatting will begin and it will take around...2 hours! yes 2 damn long interminable hours formatting ur memory card...once finish....u can enjoy having a powerful 32gb microsd on the mighty marvelous Nokia N8.
    PS: if u want to fromat by right clicking on the memory card and chooseing format...it wont work. u gotta pass through disk management processing.
    good luck
    waiting for ur feedback!
    mine is 16gb,will this work?

Maybe you are looking for