media-player

how do you get the artist and song title from MediaPlayer?

天大地大妈咪最大 提交于 2019-12-12 10:07:20
问题 I'm building a simple app for an online radio station. I using this code to use the MediaPlayer to stream the station. It works great with one problem. I don't know how to show the listener what they're actually listening too. My code: package com.xxxx.android; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.net

Audio playback lock screen controls not displaying on iPhone

半城伤御伤魂 提交于 2019-12-12 08:54:38
问题 I am testing this using iOS 10.2 on my actual iPhone 6s device. I am playing streamed audio and am able to play/pause audio, skip tracks, etc. I also have enabled background modes and the audio plays in the background and continues through a playlist properly. The only issue I am having is getting the lock screen controls to show up. Nothing displays at all... In viewDidLoad() of my MainViewController, right when my app launches, I call this... func setupAudioSession(){ UIApplication.shared

how to use ijkplayer library

馋奶兔 提交于 2019-12-12 08:48:37
问题 I'm going to use ijkplayer github link. I downloaded this and then import it to eclipse by File > Import > General > Existing Projects to Workspace. After that I have three project: 1.ijkmediaplayer ( library ) 2.ijkmediawidget ( VideoView-like interface ) 3.ijkmediademo ( Demo project ) When I run ijkmediademo, Error happened and program crashed. I got these lines of error: 07-06 14:06:26.913: E/AndroidRuntime(11394): FATAL EXCEPTION: main 07-06 14:06:26.913: E/AndroidRuntime(11394): Process

Android Mp3 play from url

一个人想着一个人 提交于 2019-12-12 08:46:17
问题 How do I run the following tutorial using an online mp3 url? I tried replacing the url but it doesn't seem to be working. I want to use the same code but with the url. Does anyone have any suggestions? The tutorial linke: http://www.tutorialspoint.com/android/android_mediaplayer.htm The mp3 url is: http://searchgurbani.com/audio/sggs/1.mp3 回答1: How to play an .mp3 from the /raw folder: Download the .mp3 file, save it to song.mp3 and paste into the /raw folder. If you don´t have /raw folder,

VideoVideo - Video Width x Height- MediaPlayer Issue

↘锁芯ラ 提交于 2019-12-12 08:12:19
问题 I have written a sample app that reproduces the problem: https://github.com/blundell/VideoRatioProblemPerDevice The VideoView documentation states: Displays a video file. ... takes care of computing its measurement from the video so that it can be used in any layout manager, and provides various display options such as scaling The problem is the Samsung Galaxy S3 is doing weird things to the video and not respecting the ratio of the video. (also happening on an HTC device). Activity with full

android mediaplayer loops forever on ICS

一曲冷凌霜 提交于 2019-12-12 07:58:29
问题 I want to play a notification sound and my problem it that the sound loops forever, when it should sound only once. I've tried two ways: notification.sound = Uri.parse("content://media/internal/audio/media/38"); and mMediaPlayer = new MediaPlayer(); mMediaPlayer.setAudioStreamType(AudioManager.STREAM_NOTIFICATION); mMediaPlayer.setDataSource(this, Uri.parse("content://media/internal/audio/media/38")); mMediaPlayer.setLooping(false); mMediaPlayer.prepare(); mMediaPlayer.setOnPreparedListener

Android Media Player: Start called in state 4 error(-38,0)

心不动则不痛 提交于 2019-12-12 07:25:35
问题 This is the code am using to fetch a file name(.mp3) dynamically from some other class as am having many mp3 files in my assets folder: playAudioButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { FileName audio=new FileName(); String audioName=audio.getAudioName(count).toString(); if(audioName=="NO Audio") { Toast.makeText(getApplicationContext(), "No Audio for this page", Toast.LENGTH_SHORT).show(); } else { try { afd=getAssets().openFd(audioName + "

Observing currentPlaybackTime and showing an overlay at intervals

瘦欲@ 提交于 2019-12-12 06:45:46
问题 I’m making a video that shows overlays at certain intervals of a video. I’ve managed to get the video to play. Now my objective is to watch/observe the currentPlaybackTime value and pause the video when it hits 2 seconds. After some research found that currentPlaybackTime does not support KOV. So I need to implement this solution but I have no idea where to put the code - I’m very new to Objective C. I keep trying to put it in the ViewController (My only view) but the way its written hints to

Android MediaPlayer not preparing. Error (1, -4)

£可爱£侵袭症+ 提交于 2019-12-12 06:36:44
问题 So I've been trying to make a simple sound effect app for android. Here is the relevant code: public static final String LOG_TAG = "BCA"; public MediaPlayer mp; @Override public void onCreate(Bundle savedInstanceState) { Log.v(LOG_TAG, "creating"); super.onCreate(savedInstanceState); setContentView(R.layout.main_list); mp = new MediaPlayer(); mp.setAudioStreamType(AudioManager.STREAM_MUSIC); Log.v(LOG_TAG, "set stream type"); playSound(); } public void playSound() { try { mp.setDataSource("R

how to control media player using script or code

China☆狼群 提交于 2019-12-12 04:18:08
问题 Is there a media player, where you can control its audio and video using script or code.for example lets say i want to pause the video after n secs, which player supports this? I am looking for free opensource solution which runs on desktop i.e windows 7. 回答1: I'm not the kind of giving the entire solution. But here's a good place to start. It shows how to embed Windows Media Player in a Windows Form. http://msdn.microsoft.com/en-us/library/bb383953(v=vs.90).aspx You'll have access to control