English 中文(简体)
闪电作用者没有在甲状腺中玩音乐
原标题:Flash player not playing music in android

我利用现场音乐。 i 用于装载html网页和闪电器。 但是,当媒体玩.时,它突然改变为停用的纽芬兰语,从而造成我不得不使用任何缓冲方法进行流放。 准则是:

   import java.io.IOException;

   import android.app.Activity;
   import android.media.AudioManager;
    import android.media.MediaPlayer;
    import android.os.Bundle;
    import android.util.Log;
     import android.view.View;
   import android.webkit.WebSettings;
    import android.webkit.WebView;
    import android.widget.Button;

public class Mymediaplayer extends Activity {
private WebView wv;
Button b1;
MediaPlayer player;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    b1=(Button)findViewById(R.id.button1);
b1.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
//  playvideofromresource();
//  playvideofromsdcard();

   setupWebView();
    //playaudiofromremorturl();

   }
     });
      }
   public void setupWebView(){
    wv = (WebView) findViewById(R.id.web_view);
    wv.setVisibility(View.VISIBLE);
    if(wv != null){
        wv.getSettings().setJavaScriptEnabled(true);
        wv.getSettings().setPluginState(WebSettings.PluginState.ON);
        wv.loadUrl("http://media.radiosai.org/www/Afristream.html");

    }
    }
    void playaudiofromremorturl()
    {
 player=new MediaPlayer();
 String urlstring="http://media.radiosai.org/www/Afristream.html";
 player.setAudioStreamType(AudioManager.STREAM_MUSIC);
 try
 {
        player.reset();
     player.setDataSource(urlstring);
     player.prepareAsync();
     player.start();
 }
 catch (IOException e) {
     e.printStackTrace();
    // TODO: handle exception
}
 player.setLooping(true);

 }
     }
问题回答

http://code.google.com/p/swfobject/“rel=“nofollow” 然后把该网页装上网上浏览。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body bgcolor="#000000" style="margin: 0; padding: 0">
<table width=800px height=600px border=1>
    <tr>
        <td>
            <div id="moviename"></div>
        </td>
    </tr>
</table>

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("main.swf", "moviename", "1024", "600", "9.0.0");
</script>
</body>
</html>




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签