EzDevInfo.com

Player

▶️ iOS video player in Swift, simple drop in component for playing and streaming media

Only one thread at a time!

Here's my code:

new Thread() {
    @Override
    public void run() {
        try { player.play(); }
        catch ( Exception e ) { System.out.println(e); }
    }
}.start();

which creates and starts a thread. I'd like to modify this code so that the thread only starts if there are no other threads open at the time! If there are I'd like to close them, and start this one. Thanks in advance!


Source: (StackOverflow)

Flash based .wav player [closed]

Does anybody know of a free/open source flash-based music player that can playback .wav files?


I am trying to playback Asterisk recorded calls in a developed console of the Caller CDR table, I am using Windows Media Player for that, but I want it to work in Firefox without having the end-user install the WM Plugin for Firefox. Any ideas?


Source: (StackOverflow)

Advertisements

Java: Guide to write a custom video codec

I have quite a weird question, but here it is:

Is it possible, and are there any guides for writing a custom video codec in C++ or Java?

Here's the weird part: I don't need to dive into those tons of info about audio and motion picture I don't understand. What I actually need is the technical stuff behind how to make a software layer between a movie player and a movie file.

Here's why: I would like to create a library or ultimately 2 functions - encode / decode - in C++ / Java, which will take the RAW binary input of any type of file and encode / decode it according to a given password or something like that. Then I need to put this processing between a movie player and a movie file. The final result will be a password protected mp4 / avi / mpeg / wmv (doesn't really matter) file, that could be played only with this "codec". The internal logic of the codec is not the issue right now.

How I imagine it is like a stream, movie player request the file and calls my encode() function, it takes a chunk of the file, decodes it (it has been previously encoded) and returns the correct bytes in wmv/mp4 and so on format.

Is any of this possible and how?


Source: (StackOverflow)

Memory in SWF (Flash Player)

Are there any limitations on the amount of memory that the flash player can use? If you have a swf that over time gets a lot of data from the server, then more and more data will be kept in memory... Is there a limitation on this?

Thx, Lieven Cardoen


Source: (StackOverflow)

How do i embed this m3u8 into jw player

Total novice here so if you can be patient with me id really appreciate it.

Now i have this url

http://213.202.73.8:1234/data/channels/ARENA1. m3u8

I want to embed this into my JW Player, I have both Jw Player 5 & 6 So whatever is easiest, Can someone help a brother out and what code would i need to embed this so it plays on the JW Player if possible.

If you could write the FULL code so i can understand coz as i said a total novice here but fast learner lol.

Cheers guys

UPDATE:

Ok so i have had a little fiddle around and after have a look around came up with this code:

<script type='text/javascript' src='jwplayer2/jwplayer.js'></script>

<div id='mediaplayer'></div>

<script type="text/javascript">
jwplayer('mediaplayer').setup({
'id': 'playerID',
'width': '480',
'height': '270',
'file': 'http://213.202.73.8:1234/data/channels/ARENA1. m3u8',
'image': '/thumbs/bunny.jpg',
'modes': [
{type: 'html5'},
{type: 'flash', src: 'player.swf'},
{type: 'download'}
]
});
</script>

So it works in safari brilliantly but not in chrome, IE, or Firefox, Any ideas as to why, When i click the play button with those browsers nothing happens simply just doesnt load the timer type thing in the middle of the player doesnt go around its trying to load something but nothing in the player lol.

Cheers guys

UPDATE 2:

If its a link to the site here it is: http://testersite.byethost22. com/test.html

UPDATE 3:

Ive also tried another one and this time it says "The video could not be loaded, either because the server or network failed or because the format is not supported:"http: //video.popler.tv:554/publishlive/4funtv/playlist.m3u8"

You can see this here: http:// testersite.byethost22. com/u. html It says this in safari only though, same problem as before with chrome etc but now when i click on the player in chrome it simply downloads a playlist.m3u8

Hope someone can help, Cheers

UPDATE 4:

Ok so if you go here: http://testersite.byethost22.com/test5.html and try and play it with an idevice you will see it works perfectly but using chrome, firefox on my pc it simply does not work, im desperate now guys if someone can help me get this working on chrome and firefox i would be estastic and a very happy happy man!! as i said either would be fine jwp5 or jwp6 so as long as it works on chrome and firefox i really dont mind. Thanks guys and please someone help lol and yes i know theres gaps in some of the urls but i had to do it like that as i dont have enough reputation points to post more than 2 links.


Source: (StackOverflow)

android mediaplayer stream online mp3 file

i have android app stream mp3 file and play this file in player , but the problem is mediaPlayer.prepare(); take long time buffer and app freeze so i tried to use prepareAsync(); // but with this function i can't make player play next file

just single file online if i need to play another file i should close restart activity when

play end not play next this is my code

and i'm sorry for my bad english

this is my code any help please

public void playMp3(String _link)
{
mediaPlayer.setOnPreparedListener(new OnPreparedListener() {
    public void onPrepared(MediaPlayer mp) {
        if(!mediaPlayer.isPlaying()){
        mediaPlayer.start();
        Progressbar.setVisibility(View.INVISIBLE);
        play.setVisibility(View.GONE);
        stop.setVisibility(View.VISIBLE);
        songProgressBar.setProgress(0);
        songProgressBar.setMax(100);
        }
        updateProgressBar();      
    }
});
mediaPlayer.setOnCompletionListener(new OnCompletionListener() {

    @Override
    public void onCompletion(MediaPlayer mp) {
        // TODO Auto-generated method stub
        mediaPlayer.reset();
        songProgressBar.setProgress(0);
        songProgressBar.setSecondaryProgress(0);
        play.setVisibility(View.VISIBLE);
        stop.setVisibility(View.GONE);
        link = "http://server11.mp3quran.net/hawashi/002.mp3";
        playMp3(link);

    }
});
mediaPlayer.setOnBufferingUpdateListener(new OnBufferingUpdateListener() {
    @Override
    public void onBufferingUpdate(MediaPlayer mp, int percent) {
       // Toast.makeText(getApplicationContext(), "n" + percent, Toast.LENGTH_LONG).show();
        songProgressBar.setSecondaryProgress(percent);

         if(percent==100)
         {
             Progressbar.setVisibility(View.INVISIBLE);

         }else if(percent > songProgressBar.getProgress())
         {
             Progressbar.setVisibility(View.INVISIBLE);
         }else
         {
             Progressbar.setVisibility(View.VISIBLE);
         }

    }
});

mediaPlayer.reset();
Progressbar.setVisibility(View.VISIBLE);
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);

try {
    mediaPlayer.setDataSource(_link);
    //mediaPlayer.prepare(); // might take long! (for buffering, etc)   //@@
    mediaPlayer.prepareAsync();
} catch (IllegalArgumentException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
} catch (SecurityException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
} catch (IllegalStateException e) {
    // TODO Auto-generated catch block///
    e.printStackTrace();
} catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}}

Source: (StackOverflow)

Flash video player for video streaming [closed]

I need a flash video player for our public site where users will share videos. The video usage model is similar to youtube as far as video part is concerned. Users will upload and share videos. Users will browse and play all shared videos as well.

The videos will be streamed from the server and our app is a .NET/C#/JQuery application.

We have 3 options:

1) Either buy a commercial flash player 
2) Customize a open source player or use free player and customize its gui 
3) Develop our own (time consuming and last resort)

I am required to find a flash video player with these requirements:

  • Player should work in all major browsers (IE, FF, Chrome, Safari)
  • Player should have way to inject Advertisement clips when playing a video file
  • Light weight and easy to integrate
  • Must support streaming and scale
  • Plus all other basic features of a flash video player

I would highly appreciate your time. Thank you very much.


Source: (StackOverflow)

Play FLV data synchronously [closed]

I am just investigating http://www.broccoliproducts.com/softnotebook/rtmpclient/rtmpclient.php RTMP client code. And it is working fine so it gets data and saves the FLV file locally.

The code is pretty simple. So my questions are:

1. Is it possible to play this streaming synchronously? (okay with some delay because of the caching) (I've tried to open writing file via VLC but it is busy...)

2. Any clue how to implement it?

!!! It is not any kind of advertisement of this project! I just need to create some RTMP Player in WPF.


Source: (StackOverflow)

How to embed audio within a website?

I have been searching for the answer for ages and I can't seem to find what I need.

I have never coded anything connected with audio stuff.

What I want to do is to embed music files within a website (Have something a'la little mp3 player on the site). I want the audience to be able to play, stop etc the songs by using custom made controllers.

How do I code those custom made buttons so that they all work fine?

I only have to code HTML and CSS (php, java etc are left for others). What would you advise me to do in order to create this feature on the template?

Thank you =)

P.S.

I have to use XHTML 1.0 Transitional


Source: (StackOverflow)

Embedd .wav files in HTML page in all browsers (no controls)

I need to play few wav files on button click. I found solution working in IE but it requires QickTime plugin for firefox.

Is there any other way?

<html>
    <head>
    	<script>
function DHTMLSound(surl) {
  document.getElementById("dummyspan").innerHTML=
    "<embed src='"+surl+"' hidden=true autostart=true loop=false>";
}
    	</script>
    </head>
    <body>
    	<h1>test</h1>
    	<span id=dummyspan></span>
    	<input type="button" value="Play" onmouseover="DHTMLSound('1.wav')">
    </body>
</html>

Source: (StackOverflow)

Alternatives to rotating buffers into Players in J2ME?

Due to (quite annoying) limitations on many J2ME phones, audio files cannot be played until they are fully downloaded. So, in order to play live streams, I'm forced to download chunks at a time, and construct ByteArrayInputStreams, which I then feed to Players.

This works well, except that there's an annoying gap of about 1/4 of a second every time a stream ends and a new one is needed. Is there any way to solve this problem, or the problem above?


Source: (StackOverflow)

Mediaelement.js malfunction in IE, no flashback works

I used the mediaelement.js in my site, i used for the example a .mp4 file with H.264 codec, works well in all browsers, but not works in any version of Internet explorer when i publish the site, on my localhost don't have any problem (the flash fallback works well) , but in my server don't works.

The code the i used is:

<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>VIDEO HTML5</title>

    <script type="text/javascript" src="player_files/jquery.js"></script>
    <script type="text/javascript" src="player_files/mediaelement-and-player.min.js"></script>
    <link rel='nofollow' href="player_files/mediaelementplayer.min.css" rel="Stylesheet" />
</head>

<body>


<video id="video1" src="http://www.teletica.com/html5/videos/precious.mp4" width="640" height="360" poster="http://www.teletica.com/html5/videos/precious.jpg" controls="controls" preload="none"></video>

<video width="640" height="360" id="video2" poster="videos/precious.jpg" controls="controls" preload="none">
    <source type="video/mp4" src="http://teletica.com/html5/videos/precious.mp4" />
    <source type="video/webm" src="http://teletica.com/html5/videos/precious.webm" />

    <object width="640" height="360" type="application/x-shockwave-flash" data="player_files/flashmediaelement.swf">        
        <param name="movie" value="player_files/flashmediaelement.swf" /> 
        <param name="flashvars" value="controls=true&file=http://teletica.com/html5/videos/precious.mp4" />         

        <img src="player_files/precious.jpg" width="640" height="360" alt="Here we are" title="No video playback capabilities" />
    </object>   
</video>

<script type="text/javascript">
    $('video, audio').mediaelementplayer();
</script>

The player works in this direction "http://www.teletica.com/html5"


Source: (StackOverflow)

ios: playing video with arbitrary nsinputstream

I would like to pass an NSInputStream into a MPMoviePlayerController, or MPMoviePlayerViewController, or whatever else.

The input stream leverages a protocol that is not supported by Apple's frameworks.

I tried creating a custom NSURLProtocol (which kind of works on a device only (not simulator)), but MediaPlayer tries to cache everything and causes the application to crash when it allocates 250MB. And video never plays.

Any ideas on how to proceed? I know some apps out there do this.

I don't really want to have to build my own media player, but it seems likely, no? Are there any examples of how to do that with only CoreMedia and not FFMPEG (etc)? Codec selection is not important to me - just the ability to play while streaming over a proprietary protocol.

Thanks!


Source: (StackOverflow)

Does J2ME Media Player on Nokia E65 work?

I'm trying to write a simple media playback application in J2ME. Currently I'm starting with the most simple thing, I just want to play wav file from resource included in the jar file. I'm using this simple code:

DataInputStream wav =
    new DataInputStream(getClass().getResourceAsStream("sample.wav"));
Player player = Manager.createPlayer(wav, "audio/x-wav");
player.addPlayerListener(this);
player.realize();
VolumeControl vc = (VolumeControl) player.getControl("VolumeControl");
if( vc != null )
    vc.setLevel(100);
player.start();

I stripped some logging code. I run it on two phones: Nokia E65 with latest firmware and Nokia 3110c with original firmware. On E65 I see that the player is created, it starts playing and there are no exceptions thrown. But I can hear nothing... The same wave file works fine with built in media player. As you see I have a player listener attached and it only receives single message: STARTED. There is no VOLUME_CHANGED and END_OF_MEDIA event.

The same jar file run on 3110c plays fine and shows all expected player events.

Any idea what may be wrong with the E65 or what I'm doing wrong? Thanks in advance.


Source: (StackOverflow)

Soundcloud Custom Player with Waveform.js and scrubber functionality

I'm working on a custom Soundcloud player for my website using waveform.js to generate waveforms. It works great but it lacks the scrubber functionality. How can I add that?

I'm not a JS wizard, still learning my ways around so I'll be very thankful for any help or suggestions!

Update IV: I found a new way of including canvas generated waveforms into original SoundCloud Custom Player sc-player.js.

First of all I found a line of code responsible for HTML structure of the player and added id="waveform" to sc-waveform container on line 529:

.append('<div class="sc-time-span"><div class="sc-waveform-container" id="waveform">
       </div><div class="sc-buffer"></div><div class="sc-played"></div></div>')

Then I updated the line 676, replacing img with canvas

    $available = $scrubber.find('.sc-waveform-container canvas'),

Next, I located a piece of code responsible for embedding the original image of waveform on line 340 and commented it out:

 // $('.sc-waveform-container', $player).html('<img src="' + track.waveform_url +'" />');

And then I posted the code below at the bottom of my page:

<script>
    SC.get("/tracks/80348246", function(track){
        var waveform = new Waveform({
            container: document.getElementById("waveform"),
            height: 40,
            innerColor: '#ffffff'   
        });
        waveform.dataFromSoundCloudTrack(track); 
    });
    //----------- end of insterted waveform.js code ----------------------
</script>

Results are very promising, Now I have fully customizable waveform and scrubber is working as well. However there are still things I'd like to fix.

  1. In Chrome, when I press play and pause, then click the waveform, the track starts playing, but the play button doesn't change its state. Then need to double click it to stop the track.

  2. The buffer and progress bar are still just the sc-player divs in the background. How could I link sc-player.js and waveform.js together so the progress is generated on the waveform canvas (as in example on http://waveformjs.org/)?

Any ideas how to fix those?

Here's the player on the live website: http://www.code.spik3s.com/rnr/


Source: (StackOverflow)