Video player using j2me to play mp4 from a directory - java-me

I want to develop a j2me application that will play a video file(.mp4) by selecting a particular directory on mobile phone(nokia s40 series).
How do i go about this?can anyone help me to initiate the above said process.

You need to use JSR-135 and JSR-75 to accomplish this.
Check http://www.forum.nokia.com/document/Java_Developers_Library_v2/GUID-96C1B6E4-C266-42A9-9581-A6EEDAC44AC4_GUID-B6B3EB3A-05F6-4CD4-920A-8ED818328681.html for Nokia implementation notes for JSR-75 FileConnection.
Check http://www.forum.nokia.com/document/Java_Developers_Library_v2/GUID-96C1B6E4-C266-42A9-9581-A6EEDAC44AC4_GUID-F227753C-29F7-4056-AB46-1BD80F83E109.html for Nokia implementation notes for JSR-135 Mobile Media.
The Javadocs can be found: http://java.sun.com/javame/reference/apis/jsr135/ and http://www.forum.nokia.com/document/Java_Developers_Library_v2/GUID-D69FC49D-783E-45CE-80D4-7A9F3EE08B2A/overview-summary.html .
Note that only certain directories are exposed via Java ME. You can find information on which folders under the System properties link in the JSR-75 link above.
Basically you want to do this:
Use FileConnection to open a directory and list it contents.
Let the user choose one of the files in the directory.
Create a video player via JSR-135 with the file path as input: Player player = Manager.createPlayer("path_to_the_file");
You also have to attach a VideoControl to the player that associoates a canvas/form to render the video on. (Use VideoControl.initDisplayMode). You also set all the video properties via this control, such as size, location etc.
Then use player.start() to start the playback.
This is a pretty good starting tutorial: http://today.java.net/pub/a/today/2005/09/27/j2me4.html

Related

How does Scratch play sounds without any problem on mobile?

If you are familiar with scratch, you'll know that Scratch 3 was built to support mobile.
Javascript audio isn't working on mobile devices shows that mobile doesn't support auto playback of audio
Scratch seems to play audio without a problem...
Does anyone know the secret behind Scratch mobile audio playing capabilities? (share pieces of code which scratch uses to play audio on mobile)
(Incase you're wondering why I need to know this, I need to use it on my website)
Read the answer carefully.
Some mobile browsers support automatic playback of audio, but ios, chrome and others require interactive actions to trigger the sound playback.You can try working with the mute attribute..
Scratch can't play sounds automatically. You have to click the Start button on any project. By "interactive actions" they mean clicks, scroll etc,.

Video on external display while app UI on device

Is it possible to play video on an external display via an HDMI connector and Apple TV while having my own app UI on the device?
Yes, it is possible, as the content displayed on the external display can either mirror the current app window, or show different windows.
The Multiple Display Programming Guide from Apple describes the process of implementing this pretty well. You may also want to look into the AirPlay Overview (in the case that the external display is AirPlay-enabled) for displaying video on the Apple TV.

playing mp3 audio file in firefox browser

I have searched for various articles about playing mp3 files in firefox but no luck.
I want something similar to this website for playing my audio files:
http://www.waatea603am.co.nz/podcasts
Can anyone tell me how is the audio files being played in the website. I want to do something similar. I cant figure out how it is being done.
Thanks
Here's the JavaScript that makes the links play sound:
http://www.waatea603am.co.nz/Resources/JavaScript/podcast-audio.js
It's basically using the HTML5 Audio element:
<script type="text/javascript">
var snd = new Audio("file.mp3"); // buffers automatically when created
snd.play();
</script>
http://www.w3.org/wiki/HTML/Elements/audio
This isn't really a "programming" question, as much as a "Firefox configuration" question.
Personally:
I don't really have any preferences of "media player" for Linux
I simply use Windows media player for Windows
Windows Media player comes built in with all recent versions of Windows
Windows media is the default file association for .mp3 on all recent versions of Windows
Consequently, Firefox automatically uses Windows Media player to play .mp3's
Here's more info:
Issues:_Sound">http://kb.mozillazine.org/Mozilla_Suite_:Issues:_Sound
http://support.mozilla.org/en-US/kb/fix-common-audio-and-video-issues
'Hope that helps .. PSM
PS:
Unfortunately, most commercial Internet radio stations seem to use Flash to broadcast audio streams. Sigh...

How can I use a UIWebview to load content from a asp.net website dynamically loading .mp4 video and get the video to play?

I have a client that has a website. The website current allows users to login and search for and play .mp4 video. The list of playlist is created dynamically where values are stored in a sql server 2008 database. My client's site is already built for smartphone utilization and did not want to recreate an iphone app. Besides it would mean loading thousands of video. Instead I thought I would use the UIWebview to load the website. This seemed to work well. However, when you try to click on and play video within the UIWebview nothing happens. This is not the case if we launch the mobile website within the apple mobile safari browser. The vide plays by kicking off in the iPhone video player. Is there any way to accomplish this same functionality with a uiwebview? Any guidance or help is appreciated.
UIWebView will play video using <video> if everything is set up correctly, either remote files or local files will work (if they are the correct format).
What does your video tag look like? In particular your src.
If you want to, for example, play an inline video the html5 for that would be something like
<video id="theVideo" controls width="280" height="160" src="yourVideo.mp4" webkit-playsinline></video>
And it would be necessary in the UIWebView to set this line
self.webView.allowsInlineMediaPlayback = YES;
Or you can also explicitly load the media player, but doing everything in HTML5 is neat and tidy and easy.

Is there HTML embeddable audio player which prevents downloading of the audio it plays?

I'm looking for an audio player (like jplayer) which can be embedded in a HTML page which will allow MP3's to be played but not downloaded.
The problem: Flash players request the audio file from the server so the URL of the MP3 is present in the HTML source and can be copy/pasted in to the address bar to download the track. This will inherently be the problem with most players.
Possible solution: The player accepts some "encrypted" (non-playable) format which is then decoded inside the player. Anything like this exist?
I am not looking for solutions which sound like:
Obfuscating the URL of the MP3
Preventing downloading of the MP3 from third party sites (eg. forums) using .htaccess
Embedding the mp3 inside a flash movie unless this can be automated, since mp3's are uploaded on a regular basis.
Having a URL which only works for a certain period of time
I don't know if this answers your question, but... Have you tried streaming your audio files via flash? I have never heard of someone being able to download a file which was dynamicly called through actionscript... but maybe i just don't know what i am talking about...

Resources