media

How can i apply CSS to print?

痴心易碎 提交于 2019-12-01 14:28:15
I am trying to print a div in one of my pages but i can't apply css when printing. Writing media="print" inside of the style tags doesn't work. What should i do? <style type="text/css" media="print"> body { font-size:medium; color:Black; font-size:14px; } input { margin:0px; font-size:14px; } .grid { border-color:Gray; border-width:1px; } .alan { border-style:none; } .grid1 { border-color:Gray; border-width:1px; } </style> Use the following: <style type="text/css"> @media print { body { /* styles */ } } </style> There is many ways for that: First: <style type="text/css"media="print"> Second:

Mediaplayer and delay in playing

陌路散爱 提交于 2019-12-01 14:19:26
I create small application which is media player. I have method where I have a song. I want to delay playing sound after I clicked a button. How I can do this delay. I want to click on the button and after 5 seconds music is playing. I am using: MediaPlayer.create to get song and mediaplayer.start() to start playing, but I don;t know how I can delay start playing my song. Use a Handler in your Activity to delay events such as starting the mediaplayer in your case: private RefreshHandler mRedrawHandler = new RefreshHandler(); private RefreshHandler mRedrawHandler = new RefreshHandler(); class

Controlling volume in C# using WMPLib in Windows

南笙酒味 提交于 2019-12-01 13:22:11
The story: I'm writing a music player controlled by voice. Previously the project used winamp for music -- which I'd like to do away with. I'd like to integrate the voice control with music player. The problem is, when changing the volume property of my media player object (mplayer.settings.volume = 5;), it changes the MASTER volume. Meaning any voice feedback will be completely inaudible while music is playing. Not cool when you're driving. If I fire up windows media player, I can change the volume of the music without affecting the master volume.. so there has to be a way. I've thought of

How can i apply CSS to print?

南楼画角 提交于 2019-12-01 13:02:45
问题 I am trying to print a div in one of my pages but i can't apply css when printing. Writing media="print" inside of the style tags doesn't work. What should i do? <style type="text/css" media="print"> body { font-size:medium; color:Black; font-size:14px; } input { margin:0px; font-size:14px; } .grid { border-color:Gray; border-width:1px; } .alan { border-style:none; } .grid1 { border-color:Gray; border-width:1px; } </style> 回答1: Use the following: <style type="text/css"> @media print { body {

Can all media queries be overriden?

走远了吗. 提交于 2019-12-01 12:56:33
I have built a responsive website with media queries to target different mobile devices but would like to have an "override all" link available on smaller devices. When clicked, the link would remove all media query styles and reset the page to default styles, exposing the site as it would at 1024px wide. Is there a way to achieve this? The only way you can do this is with Javascript. I came up with two solutions: id/class on <html> element : Apply an id or class to the html element: <html class="media-queries"> . In your media-queries, every selector will start with .media-queries : CSS

WP7 background audio resources are no longer available

泄露秘密 提交于 2019-12-01 12:52:06
I'm using BackgroundAudioPlayer for my Windows Phone 7 music & video application. After I play some music, I play video using MediaPlayerLauncher , then press Back to return to my app. There whenever I use BackgroundAudioPlayer.Instance . I receive error " The background audio resources are no longer available ". Someone on MSDN suggests using try/catch, but this is not a good idea, and can slow down the app. Other suggests call BackgroundAudioPlayer.Instance.Close() before launch MediaPlayer . However, when I play music, the agent load .dll again, which takes very much time. How to fix this ?

android scanning all .mp3 files in SD Card

◇◆丶佛笑我妖孽 提交于 2019-12-01 12:42:43
I'm trying to scan all .mp3 files in my SD card and save its name. here is a fragment of code which is responsible for that. 1.What i'm doing wrong? 1. Which is correct path for SD Card /mnt/sdcard or /sdcard ? public class PlayerActivity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.player_activity); } public class SongsManager { // SDCard Path //final String MEDIA_PATH = new String(MediaStore.Audio.Media.getContentUri("external").toString()); private ArrayList<HashMap<String, String>> songsList = new ArrayList

WP7 background audio resources are no longer available

微笑、不失礼 提交于 2019-12-01 11:45:15
问题 I'm using BackgroundAudioPlayer for my Windows Phone 7 music & video application. After I play some music, I play video using MediaPlayerLauncher , then press Back to return to my app. There whenever I use BackgroundAudioPlayer.Instance . I receive error " The background audio resources are no longer available ". Someone on MSDN suggests using try/catch, but this is not a good idea, and can slow down the app. Other suggests call BackgroundAudioPlayer.Instance.Close() before launch MediaPlayer

Android: playing a song file using default music player

最后都变了- 提交于 2019-12-01 11:13:35
Is there a way to play media with the default media player? I can do this with the following code: Intent intent = new Intent(Intent.ACTION_VIEW); MimeTypeMap mime = MimeTypeMap.getSingleton(); String type = mime.getMimeTypeFromExtension("mp3"); intent.setDataAndType(Uri.fromFile(new File(songPath.toString())), type); startActivity(intent); But this launches a player with less controls and can't be pushed to the background. Can I launch the player with the default media player? Try the below code::: Intent intent = new Intent(MediaStore.INTENT_ACTION_MUSIC_PLAYER); File file = new File

How to determine a video file's framerate with MediaCodec, MediaExtractor or MediaMetadataRetriever?

青春壹個敷衍的年華 提交于 2019-12-01 06:46:14
问题 How to I extract the frame rate of a recorded video file? I know that there is MediaFormat.KEY_FRAME_RATE and that I can access MediaFormat objects through MediaExtractor. However KEY_FRAME_RATE is only available for encoders. Instead I want to find out the frame rate of an already recorded video. Any ideas? 回答1: It looks like there is no way to get framerate through any of official API functions. It might require some extra logic - count times between timestamps or to parse headers info. in