Play video from memory/cache

Hi All,
Is it possible to play video from memory or cache? I trying to build a video player. And I am using NetStream.play(). It can play a local file,  but how can I load the a file into memory first, do some modification, and then play it?
Thanks a lot!

If you mean "can I play a video file's video part via AppleTV and the audio part via the Macbook" then the answer is no.
You could probably play the video on AppleTv and also play it on the Macbook and output the audio, but you would have to do this manually, and 2 applications accessing the same video file might cause stuttering playback issues. Additionally you'd have to manually sync the audio and lip sync problems are annoying at the best of times.
If you mean "can I watch a video from AppleTV and play separate music via iTunes on the Macbook", then the answer is yes.
AC

Similar Messages

  • Playing video from a capture device - Out of memory for video buffers?

    Hello guys, I'm having problems playing video from a video capture device when not using JMStudio. When I use JMStudio, the video plays real time with no problems, but when I use code taken from a java book which is a simple Media Player, I get the following error:
    "Error is Error: Out of memory for video buffers."
    My capture device is working and I don't know why i get this error when trying to watch the video feed from a program other than JMStudio. I also tried different code that has worked in the past with the same exact capture device and I still get the same error. Please help, I have no clue at this point. The code for the simple media player is below, it's taken out of the book "Java: How to Program (4th edition)":
    Thanks in advance, I am very greatful
    Miguel
    device info: vfw:Microsoft WDM Image Capture (Win32):0
    When I type the locator, I am typing vfw://0, I also tried just vfw://
    and I get the same error.
    // Fig. 22.1: SimplePlayer.java
    // Opens and plays a media file from
    // local computer, public URL, or an RTP session
    // Java core packages
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    // Java extension packages
    import javax.swing.*;
    import javax.media.*;
    public class SimplePlayer extends JFrame {
         // Java media player
         private Player player;
    // visual content component
    private Component visualMedia;
    // controls component for media
    private Component mediaControl;
    // main container
    private Container container;
    // media file and media locations
    private File mediaFile;
    private URL fileURL;
    // constructor for SimplePlayer
    public SimplePlayer()
    super( "Simple Java Media Player" );
    container = getContentPane();
    // panel containing buttons
    JPanel buttonPanel = new JPanel();
    container.add( buttonPanel, BorderLayout.NORTH );
    // opening file from directory button
    JButton openFile = new JButton( "Open File" );
    buttonPanel.add( openFile );
    // register an ActionListener for openFile events
    openFile.addActionListener(
    // anonymous inner class to handle openFile events
    new ActionListener() {
    // open and create player for file
    public void actionPerformed( ActionEvent event )
    mediaFile = getFile();
    if ( mediaFile != null ) {
    // obtain URL from file
    try {
    fileURL = mediaFile.toURL();
    // file path unresolvable
    catch ( MalformedURLException badURL ) {
    badURL.printStackTrace();
    showErrorMessage( "Bad URL" );
    makePlayer( fileURL.toString() );
    } // end actionPerformed
    } // end ActionListener
    ); // end call to method addActionListener
    // URL opening button
    JButton openURL = new JButton( "Open Locator" );
    buttonPanel.add( openURL );
    // register an ActionListener for openURL events
    openURL.addActionListener(
    // anonymous inner class to handle openURL events
    new ActionListener() {
    // open and create player for media locator
    public void actionPerformed( ActionEvent event )
    String addressName = getMediaLocation();
    if ( addressName != null )
    makePlayer( addressName );
    } // end ActionListener
    ); // end call to method addActionListener
    // turn on lightweight rendering on players to enable
    // better compatibility with lightweight GUI components
    Manager.setHint( Manager.LIGHTWEIGHT_RENDERER,
    Boolean.TRUE );
    } // end SimplePlayer constructor
    // utility method for pop-up error messages
    public void showErrorMessage( String error )
    JOptionPane.showMessageDialog( this, error, "Error",
    JOptionPane.ERROR_MESSAGE );
    // get file from computer
    public File getFile()
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setFileSelectionMode(
    JFileChooser.FILES_ONLY );
    int result = fileChooser.showOpenDialog( this );
    if ( result == JFileChooser.CANCEL_OPTION )
    return null;
    else
    return fileChooser.getSelectedFile();
    // get media location from user input
    public String getMediaLocation()
    String input = JOptionPane.showInputDialog(
    this, "Enter URL" );
    // if user presses OK with no input
    if ( input != null && input.length() == 0 )
    return null;
    return input;
    // create player using media's location
    public void makePlayer( String mediaLocation )
    // reset player and window if previous player exists
    if ( player != null )
    removePlayerComponents();
    // location of media source
    MediaLocator mediaLocator =
    new MediaLocator( mediaLocation );
    if ( mediaLocator == null ) {
    showErrorMessage( "Error opening file" );
    return;
    // create a player from MediaLocator
    try {
    player = Manager.createPlayer( mediaLocator );
    // register ControllerListener to handle Player events
    player.addControllerListener(
    new PlayerEventHandler() );
    // call realize to enable rendering of player's media
    player.realize();
    // no player exists or format is unsupported
    catch ( NoPlayerException noPlayerException ) {
    noPlayerException.printStackTrace();
    // file input error
    catch ( IOException ioException ) {
    ioException.printStackTrace();
    } // end makePlayer method
    // return player to system resources and
    // reset media and controls
    public void removePlayerComponents()
    // remove previous video component if there is one
    if ( visualMedia != null )
    container.remove( visualMedia );
    // remove previous media control if there is one
    if ( mediaControl != null )
    container.remove( mediaControl );
    // stop player and return allocated resources
    player.close();
    // obtain visual media and player controls
    public void getMediaComponents()
    // get visual component from player
    visualMedia = player.getVisualComponent();
    // add visual component if present
    if ( visualMedia != null )
    container.add( visualMedia, BorderLayout.CENTER );
    // get player control GUI
    mediaControl = player.getControlPanelComponent();
    // add controls component if present
    if ( mediaControl != null )
    container.add( mediaControl, BorderLayout.SOUTH );
    } // end method getMediaComponents
    // handler for player's ControllerEvents
    private class PlayerEventHandler extends ControllerAdapter {
    // prefetch media feed once player is realized
    public void realizeComplete(
    RealizeCompleteEvent realizeDoneEvent )
    player.prefetch();
    // player can start showing media after prefetching
    public void prefetchComplete(
    PrefetchCompleteEvent prefetchDoneEvent )
    getMediaComponents();
    // ensure valid layout of frame
    validate();
    // start playing media
    player.start();
    } // end prefetchComplete method
    // if end of media, reset to beginning, stop play
    public void endOfMedia( EndOfMediaEvent mediaEndEvent )
    player.setMediaTime( new Time( 0 ) );
    player.stop();
    } // end PlayerEventHandler inner class
    // execute application
    public static void main( String args[] )
    SimplePlayer testPlayer = new SimplePlayer();
    testPlayer.setSize( 300, 300 );
    testPlayer.setLocation( 300, 300 );
    testPlayer.setDefaultCloseOperation( EXIT_ON_CLOSE );
    testPlayer.setVisible( true );
    } // end class SimplePlayer

    somebody? anybody? I know there are some JMF professionals in here, any ideas?
    I was reading the Sun documentation and it said something about increasing the JVM memory buffer or something? Well, i'm just clueless at this point.
    Help a brotha out!

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

  • How do I play video from my macbook pro to my tv?

    How do I play video from my macbook pro to my tv?

    What model MacBook Pro do you have? On my late 2011, I used to use a Mini DisplayPort/Thunderbolt to HDMI adapter to get video and audio from my Mac to my television. I used this adapter from Monoprice. Worked great - I just no longer use it because I bought a 27" monitor.
    You can also use AirPlay mirroring if you've the right MBP and an Apple TV - but the wired method works, too.
    Clinton

  • Play video from external HD to Apple TV

    I would like to play videos from an external drive to the Apple TV.
    The workarounds I've seen all involve moving the entire iTunes library to the external drive. I want to keep all my music on the internal HD but the videos on the external HD.
    Suggestions?

    Launch iTunes on your computer
    Mac - iTunes > Preferences > Advanced
    PC - Edit > Preferences > Advanced
    Uncheck 'Copy files to iTunes media folder when adding to library'
    This will allow you to drag and drop videos from the external drive to iTunes without copying to the internal drive. Once in iTunes you should be able to watch them on your Apple TV
    Hope that helps

  • Playing videos from iTunes onto a TV from my iPad

    Can I play videos from iTunes onto a TV from my iPad. All I seem to be able to get is the music when I connect via an HDMI cable or wirelessly to apple TV.
    Thanks
    Terry

    I have sorted now. Play through video app not music. Easy when you know how!!!

  • I have just bought a MacBook Air and i cannot play videos from the internet as it asks for a flash player to be installed i try to download Adobe flash player and it will not allow me to do so?

    I have just bought a MacBook Air and i cannot play videos from the internet as it asks for a flash player to be installed i try to download Adobe flash player and it will not allow me to do so?

    Ziatron is correct that Flash does not work on an iPad, but it does work on a Mac. See Adobe Flash Player 11.2.202.160.

  • Playing video from iPad to TV

    I bought the AV cable at the Apple store yesterday and tried it out. I can play
    video from the Video app, the Netflix app, and the YouTube app without a
    problem. But I can't play anything from the ABC app or the Hulu Plus app (the
    free stuff - I'm not subscribed yet) or the HGTV app. I get sound, but no
    picture. Anyone know why? Am I doing something wrong?

    I just tried to watch from the ABC Player on the TV, doesn't work. The app description in the app store doesn't indecate you can watch it on a TV. And there nowhere on the app to switch viewing from the iPad to the TV. So, I would say you can't view this on a TV.

  • I can't play videos from you tube or Hulu on my ipad but they play fine on the iPhone, why is that and how can I fix it ?

    WHy can't I  play videos from you tube or watch Hulu on the ipad.......they play fine on the iPhone, how can I fix this ?

    Start by providing some relevant information if you need troubleshooting help. We have no idea how or what you are doing whatever it is that you are doing.

  • Firefox only can't play videos from Hamster web site

    Firefox plays videos from every other site but Hamster. IE and Chrome have no problems playing videos from this site

    Hi .
    Make sure your OS X software is up to date.
    Click the Apple  top left in your screen. From the drop down menu click Software Update.
    Or, open System Preferences > App Store > Check Now
    If your Mac is up to date, most news websites require Flash.
    Back to System Preferences > Flash Player then select the Advanced tab.
    Click: Check Now

  • IPad stop playing videos from sites

    Today my iPad stopped playing videos from site. IT WORKED YESTERDAY so iPad CAN play it. When Im trying to play video there is a crossed triangle so I can't press it. Please help!

    Its not theirs (player) they posts videos from vk.com . On this site it's ok to run video but on all of the others which have videos from vk it's not working.

  • How to play videos from cnn?

    how to play videos from cnn?

    cnn.com   listenlive.eu    sites for news and music but its saves on phone and can't open it. I think they are in wmp.   is there a player that play and open different formats?

  • Is there a software like flash player for ipad.what software do I exactly need in order to play videos from websites?

    Is there a software like flash player for ipad.what software do I exactly need in order to play videos from websites?

    NKafafi88-
    There may be a couple Apps that may help, but I understand they don't work very well.  The best solution would be to contact the owners of the websites and let them know they need to update their site.
    The alternative I use, is to download the problem video onto my computer, and convert it to M4V or MP4 format using a program like HandBrake <HandBrake>.  Then it can be added to iTunes and synced with the iPad.
    Fred

  • I am not able to play videos from YoyTube, or videow posted on my blog. That does not happens with explorer, where videos are playing normal

    I am not able to play videos from YouTube, or videow posted on my blog, when I use Fire Fox. That did not happened before the 3.6.14 and allthouhg you informed us that with the 3.6.15 the problem will dissapear, it does not happen. Take into consideration that, with explorer, everything is running fine. I am a long time user o firefox and I donnot want to change. Please give me advise how to solve thiw problem. Tanhks in advance

    Hi, My computer shuts down when I try to do any thing with graphics, ie, watching streamed video or looking at my photo's. this is a recent problem, anyone got any idea's

  • Flash Player 11.6.602.180 installed on Win 7 with IE and can never play videos from

    Hi, I installed Flash Player 11.6.602.180 installed on Win 7 with IE and can never play videos from this site http://w3.newsmax.com/newsletters/uwr/video_hyman.cfm?s=al&promo_code=12CF6-1
    any idea what this site is looking for ? thanks bill m

    What do you see instead of the expected Flash content?

Maybe you are looking for