EzDevInfo.com

playback

Video player build using atom-shell and node.js Playback Video Player

How do you to check if a user has rated your app on the android market?

I want to check to see if a user has rated my app on the android market, not how many stars, just if they have. And if they haven't I will prompt them with a dialog asking them to rate it with this code:

startActivity( new Intent( Intent.ACTION_VIEW,
       Uri.parse("market://details?id=packagename") ) );

Source: (StackOverflow)

Play simple beep with python without external library

Using only the modules that come with a standard python 2.6 installation, would it be possible to play a simple beeping noise?


Source: (StackOverflow)

Advertisements

How to play video from NSData

HI everyone, I would like to know if it's possible to play a video from an NSData object... with the MPMoviePlayerController.

Thanks in advance, Sergio


Source: (StackOverflow)

What does this gdb output mean?

I've got a button that plays a sound, and it seems to work perfectly fine on the simulator, but i'm getting this message:

Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:  dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security
2011-11-01 02:13:02.605 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:  dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security
2011-11-01 02:13:02.657 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security
2011-11-01 02:13:02.671 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security
2011-11-01 02:13:02.706 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security
2011-11-01 02:13:02.715 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security
2011-11-01 02:13:02.732 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security
2011-11-01 02:13:02.741 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security

And i've had reports saying, on some devices it's not playing at all.


Source: (StackOverflow)

HTML5 Audio and jQuery

I am trying to use a button to start a track in an HTML5 audio tag using jQuery, but I keep getting an error.

var song = $('#audio');

$('#play').click(function() {
song.play();
});

When I use document.getElementById('audio'), it works, but when using the jQuery selector I get the following error:

Uncaught TypeError: Object [object Object] has no method 'play'

Thanks for any help.


Source: (StackOverflow)

Play two sounds simultaneusly

Is there a way to play two sounds at the same time?

I know that SoundPlayer isn't able to do this. I can't use SoundEffect as I believe it's only part of XNA.

The two required sounds will be called at unknown and random times. The sound needs to be be controlled after it is played. i.e., the sound must be able to be stopped before it has finished playing.


Source: (StackOverflow)

Event for VideoView playback state or MediaController play/pause

I cant seem to find an event that listens for playback state. I am mostly interested in the play/pause state. I am using MediaController which has a Play/Pause button, but I have a secondary button that also controls Play/Pause. Using my custom button, I can play/pause, but if I play/pause using the MediaController play/pause button, I currently have no way to change the image on my custom play/pause button to either play or pause.

Is there an event that I do not know about so I can do some work during play/pause?

This is a very similar question: How to catch event when click pause/play button on MediaController


Source: (StackOverflow)

MediaPlayer stutters at start of mp3 playback

I've been having a problem playing an mp3 file stored in a raw resource: when the file first starts playing, it generates perhaps a quarter of a second of sound and then restarts. (I know that this is basically a duplicate of the problem described here, but the solution offered there hasn't worked for me.) I have tried several things and have made some progress on the problem, but it isn't totally fixed.

Here's how I'm setting up to play a file:

mPlayer.reset();
try {
    AssetFileDescriptor afd = getResources().openRawResourceFd(mAudioId);
    if (afd == null) {
        Toast.makeText(mOwner, "Could not load sound.",
                Toast.LENGTH_LONG).show();
        return;
    }
    mPlayer.setDataSource(afd.getFileDescriptor(),
            afd.getStartOffset(), afd.getLength());
    afd.close();
    mPlayer.prepare();
} catch (Exception e) {
    Log.d(LOG_TAG, "Could not load sound.", e);
    Toast.makeText(mOwner, "Could not load sound.", Toast.LENGTH_LONG)
            .show();
}

If I exit the activity (which calls mPlayer.release()) and come back to it (creating a new MediaPlayer), the stutter is usually (but not always) gone—provided I load the same sound file. I tried a couple of things that made no difference:

  • Load the sound file as an asset instead of as a resource.
  • Create the MediaPlayer using MediaPlayer.create(getContext(), mAudioId) and skip the calls to setDataSource(...) and prepare().

Then I noticed that LogCat always shows this line at about the time that playback starts:

DEBUG/AudioSink(37): bufferCount (4) is too small and increased to 12

It got me wondering if the stuttering is due to the apparent rebuffering. This led me to try something else:

  • After calling prepare(), call mPlayer.start() and immediately call mPlayer.pause().

To my pleasant surprise, this had a big effect. A great deal of the stutter is gone, plus no sound (that I can hear) is actually played at that point in the process.

However, it still stutters from time to time when I call mPlayer.start() for real. Plus, this seems like a huge kludge. Is there any way to kill this problem completely and cleanly?

EDIT More info; not sure if related. If I call pause() during playback, seek to an earlier position, and call start() again, I hear a short bit (~1/4 sec) of additional sound from where it was paused before it starts playing at the new position. This seems to point to more buffering problems.

Also, the stuttering (and paused buffer) problems show up on emulators from 1.6 through 3.0.


Source: (StackOverflow)

Video playback in Java ( JMF, Fobs4JMF, Xuggler, FMJ )

I need simple video playback in Java.

Here are my requirements:

  • PRODUCTION QUALITY

  • Open and decode video files whose video and audio codecs can be chosen by me. I.E I can pick well behaving codecs.

  • Be able to play, pause, seekToFrame OR seekToTime and stop playback. Essentially I wish to be able to play segments of a single video file in a non linear fashion. For example I may want to play the segment 20.3sec to 25.6sec, pause for 10 seconds and then play the segment 340.3sec to 350.5sec, etc.

  • During playback, video and audio must be in sync.

  • The video must be displayed in a Swing JComponent.

  • Must be able to use in a commercial product without having to be open source (I.E. LGPL or Comercial is good)


My research has led me to the following solutions:

I have implemented a quick prototype and this seems to do what I need. I can play a segment of video using:

player.setStopTime(new Time(end));
player.setMediaTime(new Time(start));
player.start();

While Fobs4JMF seems to work, I feel the quality of the code is poor and the project is no longer active. Does anyone know of any products which use Fobs4JMF?


  • Write a Flash application which plays a video and use JFlashPlayer to bring it into my Java Swing application

Unlike Java, Flash is brilliant at playing video. I could write a small Flash application with the methods:

open(String videoFile),
play(),
pause(),
seek(int duration),
stop()

Then bring it into Java using JFlashPlayer which can call Flash functions from Java.

What I like about this solution is that video playback in Flash should be rock solid. Has anyone used JFlashPlayer to play video in Java?


  • Write a simple media player on top of Xuggler

Xuggler is an FFMpeg wrapper for Java which seems to be a quite active and high quality project. However, implementing the simple video playback described in the requirements is not trivial (Seeking in particular) but some of the work has been done in the MediaTools MediaViewer which would be the base upon which to build from.


  • Use FMJ

I have tried to get FMJ to work but have had no sucess so far.


I would appreciate your opinions on my problem.


Source: (StackOverflow)

Directory for storing audio files in Android

I am new to developing for Android, and am figuring my way around.

I want to play an audio file based on the click of a button. I have defined the onClickListener() method and the layout file. When I add the wav files to the res/ directory, I get the following build error:

invalid resource directory name temp.wav /hello/res line 1  Android AAPT Problem

My question is as follows:
1. What directory do I need to store audio files in? Currently they are in the res/ folder.
2. Also, mp.setDataSource("/res/temp.wav") the correct way to invoke the media player?

Thanks, Sriram


Source: (StackOverflow)

Play sound on button click android

tried many tutorials, youtube, stackoverflow, none work :(

help me please to get the button play a sound from raw when click. I just created a button with id button1, and what code I write all is wrong. :(

import android.media.MediaPlayer;

public class BasicScreenActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_basic_screen);
    }

    Button one = (Button)this.findViewById(R.id.button1);
    MediaPlayer = mp;
    mp = MediaPlayer.create(this, R.raw.soho);
    zero.setOnCliclListener(new View.OnClickListener() )

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.basic_screen, menu);
        return true;
    }



}

Source: (StackOverflow)

cocoa playing an mp3

Is there an easy way to load, play and control an mp3 file from cocoa? Tried googling it, but, as all things apple, i get messy results and have no idea where to start. As i understand, there's and NSSound, but it has lots of limitations and then there's CoreAudio, but it's very difficult. So can someone point me in a right direction with this? Thanks.


Source: (StackOverflow)

Android video streaming example [closed]

I want to implement video streaming in my project. So, is there any tutorial that works? Videos are stored at server side. So, to fetch video using URL and play it on Android. I tried some examples, but I got error, "Sorry, this video can not be played". I am trying to use MP4.


Source: (StackOverflow)

Setting playback device by executing a batch file / powershell script

I've got my computer(Windows 7) hooked up to the TV, and i very often change output device for sound between Digital Audio (S/PDIF)(High definition audio device) and my headset (2- Corsair CA-HS1 USB Headset)

I wanna be able to execute a batch/script file who changes this for me so i don't have to "right click volume > playback devices > "Mark output device" and click "set default".

I know it's a luxury problem, but hey, maybe I can learn something from someone?

All help appreciated!


Source: (StackOverflow)

playback video full screen

I am trying to play a video in my app. It has to be embedded.

I went through the "Play Video Files in Android" thread.

I am able to play my video using VideoView as mentioned in this discussion. But there are a few problems.

  1. I need full screen video, how do I stretch VideoView to full screen? Will that stretch the video too?

  2. I don't need the default play/forward/stop buttons at all. Basically I need continuous loop playing of the video.

I tried the MediaPlayer class as in here, but it never worked. What should the string format look like if I have my video file in res/raw directory? I really don't want the video file played from sdcard. How can it be bundled along with the app?

If any of these two approaches work, I will be better off.

This is my code:

videoHolder = new VideoView(this); 
// videoHolder = (VideoView)findViewById(R.id.videoview); 
LayoutParams params = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); 
videoHolder.setLayoutParams(params); 
videoHolder.setMediaController(new MediaController(this)); 
setContentView(videoHolder); 
// 
// 
//// I tested and found that it works fine for .wmv, .3gp and .mp4 
//// videoHolder.setVideoURI(Uri.parse("file:///sdcard/video.3gp")); 
videoHolder.setVideoURI(Uri.parse("res/raw/demo.3gp")); 
videoHolder.requestFocus(); 
videoHolder.start(); 

Strangely the commented url works (the one with sdcard). The other one does not work. I have tried many combinations from "file:// res/raw/demo.3gp" to only "demo".

What would be the correct string to access the file?


Source: (StackOverflow)