playback

How to play a video file in android?

荒凉一梦 提交于 2019-11-30 05:11:44
I am placed video MP4 to my domain space. I have its public URL, Now i want to play it in my android app; but don't know how can I do this. I used following code which is not working. Track controller is moving but I can't see any video on screen. public class MPlayer extends Activity{ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.playvideo); VideoView videoView = new VideoView(MPlayer.this); videoView.setMediaController(new MediaController(this)); videoView.setVideoURI(Uri.parse("http://www.semanticdevlab.com/abc.mp4"));

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

丶灬走出姿态 提交于 2019-11-29 23:02:28
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

Android comprehensive failproof music service across multiple activities

醉酒当歌 提交于 2019-11-29 23:01:34
I know this question has been asked many times before and might seem to be a conglomeration of several questions, but I feel that it is relevant and important to many developers; I need to create a background music Service that can run across multiple activities for my Android game that ends when the application is terminated and pauses in all of the following circumstances: A certain Activity that has its own music is started. (Resume when this Activity finishes. This happens to be an AndEngine activity.) The home screen is pressed and the app is backgrounded, or the application is terminated

Media element Rewind

匆匆过客 提交于 2019-11-29 17:07:40
In my application, I play a video file using the MediaElement control, and I need to have fast forward and rewind options. For fast forward, I increased the SpeedRatio , but how can I implement fast rewind? I want to play the video in reverse (in appropriate speed ratio). You could set the MediaElement.ScrubbingEnabled property to true, and pause the MediaElement, and then periodically change its MediaElement.Position property backwards to mimic the rewinding behaviour. 来源: https://stackoverflow.com/questions/10880331/media-element-rewind

How can I start a flash video from javascript?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 16:51:26
Is it possible to start playing a file inside a flash player by making use of javascript code? If so, how would I do it? Try using swfObject , you can make any actionscript function visible for javascript using ExternalInterface and declaring them into javascript. So you can trigger actionscript function with play() (or any other code you want) from your javascript code. Here is an example: Actionscript: import flash.external.ExternalInterface; ExternalInterface.addCallback( "methodName", this, method ); function method() { trace("called from javascript"); } Javascript: function callAS() { swf

Toggle button visibility in android activity

久未见 提交于 2019-11-29 10:54:05
I have an activity with two play and pause buttons (currently invisible) and a seekbar. When I press the play button, the pause button should become visible, and when I press the pause button it should turn invisible. How would I do that? import android.media.MediaPlayer; import android.os.Bundle; import android.app.Activity; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; public class MainActivity extends Activity implements Runnable, OnClickListener,

Python: Playing a music in the background?

寵の児 提交于 2019-11-29 08:46:14
I am currently making a game in Python. I am not using PyGame, just the console (non-GUI) When you start the game, you will get the logo to the game, and a lot of information about the "journey" you just started. There is a lot of text, so while the text is scrolling, I want to have a song played in the background. I start the music with the following code: def new_game(): import winsound winsound.PlaySound("intro.wav", winsound.SND_ALIAS) LVL1_INTRO() The only problem is: it won't continue to LVL1_INTRO() until the music have stopped playing. It's a problem, as the music is approximately 1-2

AVPlayer cannot resume upon Wifi drops in iOS 8

人盡茶涼 提交于 2019-11-29 07:04:55
I'm using AVPlayer to play streaming video. When Wifi drops and later enables, I see that AVPlayer cannot resume, no matter how many times I call AVPlayer play , and its currentItem 's duration is NaN, seekableTimeRanges is empty. This is not the case for iOS 7, it resumes and plays well. The workaround I can think of is to restart the player. How to deal with this? 来源: https://stackoverflow.com/questions/28059019/avplayer-cannot-resume-upon-wifi-drops-in-ios-8

Playing Audio in HTML

我的未来我决定 提交于 2019-11-29 06:31:25
I want to play a mp3 audio file in HTML. I don't want to display the whole player with controls like Volume etc. I just need a play/pause button, Designed by me, not the core design of some player, like yahoo player, or google one. For example the audio will be autoplay. When a button (probably an image) is clicked it will pause, and when that image is clicked again, the audio will play again. There are quite few examples here : http://www.w3schools.com/html/html_sounds.asp Can I control any of them to play/stop from JS code ? You can use the html5 audio tag . You can specify your own controls

Playing music in sleep/standby mode in Android 2.3.3

邮差的信 提交于 2019-11-29 05:21:02
I am trying to develop a simple media player to play mp3's of the sdcard/music directory for Android 2.3.3. The problem is when I hit the power button or when the device goes to sleep, the music stops. From googling, and searching stackoverflow, I found that I need to use the wake lock options, but no matter what I do, the music stops when the device goes to sleep (Pressing F7 on the emulator stops the music as well). Since I've been fighting this for way too long, I thought I'd ask for help. I would sincerely appreciate any input. Thanks. Here's my code: FileInputStream fis = new