Embedding Windows Media Player for all browsers

The following works for me in Firefox and Internet Explorer: <object id=”mediaplayer” classid=”clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95″ codebase=”http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701″ standby=”loading microsoft windows media player components…” type=”application/x-oleobject” width=”320″ height=”310″> <param name=”filename” value=”https://stackoverflow.com/questions/164/./test.wmv”> <param name=”animationatstart” value=”true”> <param name=”transparentatstart” value=”true”> <param name=”autostart” value=”true”> <param name=”showcontrols” value=”true”> <param name=”ShowStatusBar” value=”true”> <param name=”windowlessvideo” value=”true”> <embed src=”https://stackoverflow.com/questions/164/./test.wmv” autostart=”true” showcontrols=”true” showstatusbar=”1″ bgcolor=”white” width=”320″ height=”310″> </object>

How to record video from background of application : Android

1- I have created a activity to start service like this: package com.android.camerarecorder; import android.app.Activity; import android.content.Intent; import android.hardware.Camera; import android.os.Bundle; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.widget.Button; public class CameraRecorder extends Activity implements SurfaceHolder.Callback { private static final String TAG = “Recorder”; public static SurfaceView mSurfaceView; public static SurfaceHolder mSurfaceHolder; public static Camera … Read more

How to interact with Windows Media Player in C#

Just add a reference to wmp.dll (\windows\system32\wmp.dll) using WMPLib; And then you can instantiate a media player var Player = new WindowsMediaPlayer(); // Load a playlist or file and then get the title var title = Player.controls.currentItem.name; See Creating the Windows Media Player Control Programmatically for more information

JavaScript Play Uploaded Audio

[EDIT] One should not use the FileReader API to load an user selected File into its page. Instead one should prefer the URL.createObjectURL(File) method. This will return a blobURI, only accessible from user session, which, in case of user File, is just a direct pointer to the original file, thus taking almost nothing in memory. … Read more

Using cache in ExoPlayer

Here is the solution for ExoPlayer 2.+ Create a custom cache data source factory public class CacheDataSourceFactory implements DataSource.Factory { private final Context context; private final DefaultDataSourceFactory defaultDatasourceFactory; private final long maxFileSize, maxCacheSize; public CacheDataSourceFactory(Context context, long maxCacheSize, long maxFileSize) { super(); this.context = context; this.maxCacheSize = maxCacheSize; this.maxFileSize = maxFileSize; String userAgent = Util.getUserAgent(context, … Read more

How to bind dynamic content using ?

Like as in <p:graphicImage>, the value attribute can point to a bean property returning StreamedContent. This only requires a special getter method for the reasons which is explained in detail in the following answer on using <p:graphicImage> with a dynamic resource from a database: Display dynamic image from database with p:graphicImage and StreamedContent. In your … Read more

Scan Android SD card for new files

I’ve tried plenty of different methods to trigger the MediaScanner, and these are my results. SendBroadcast The most simple and naive solution. It consists in executing the following instruction from your code: sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(“file://”+ Environment.getExternalStorageDirectory()))); However, this no longer works in KitKat devices, due to a lack of required permissions. MediaScannerWrapper As posted here … Read more

Play sound using soundpool example

Create a folder named as raw under your_app/res/. Then paste your ringtone in this folder, for example your_app/res/raw/ringtone.mp3. Now use the following code: SoundPool soundPool = new SoundPool(5, AudioManager.STREAM_MUSIC, 0); int soundId = soundPool.load(context, R.raw.ringtone, 1); // soundId for reuse later on soundPool.play(soundId, 1, 1, 0, 0, 1); Be sure to release the SoundPool resources … Read more

Playing BG Music Across Activities in Android

You can also create a service which play music using mediaplayer as below. Intent svc=new Intent(this, BackgroundSoundService.class); startService(svc); //OR stopService(svc); public class BackgroundSoundService extends Service { private static final String TAG = null; MediaPlayer player; public IBinder onBind(Intent arg0) { return null; } @Override public void onCreate() { super.onCreate(); player = MediaPlayer.create(this, R.raw.idil); player.setLooping(true); // … Read more