media

Android emulate/send ACTION_MEDIA_BUTTON intent

强颜欢笑 提交于 2020-01-01 12:00:16
问题 I am trying to control universal music playback (play/pause, skip etc.) by emulating headset music controls. Is there a way to broadcast the ACTION_MEDIA_BUTTON intent? I tried the regular way with sendBroadcast() but it didn't work. Is this possible? 回答1: Try this long eventtime = SystemClock.uptimeMillis(); Intent downIntent = new Intent(Intent.ACTION_MEDIA_BUTTON, null); KeyEvent downEvent = new KeyEvent(eventtime, eventtime, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE, 0);

MEDIA_TYPE_IMAGE not recognized

风格不统一 提交于 2020-01-01 09:10:47
问题 I'm having trouble with the resource on android developers for the camera, here is my code: // create Intent to take a picture and return control to the calling application Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a file to save the image intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file name // start the image capture Intent startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST

How to Get Historical Data from Instagram API

孤街醉人 提交于 2020-01-01 09:06:29
问题 I'm making an Instagram analytics web app. I've carefully read all of the Instagram API endpoints and I can't find any way to get historical data (ie, followers over time). All I would need would be something like a date followed, attached to each follower object. However, there are Instagram analytics sites that offer this, for example, minter.io. https://minter.io/faq#faq-posting-1 From link above: " Minter.io provides full historical data on Instagram accounts and hashtags except for:

Setting audio file media metadata in Android (ID3)

半城伤御伤魂 提交于 2019-12-31 03:55:07
问题 I am trying to find out if there is a way to set media metadata (mainly ID3 such as artist, album, song, ...) on an anudio file in Android. I have noticed that it is possible to retrieve such information using MediaMetadataRetriever but cannot find out a way to set it. Can you please help? Is it possible? 回答1: You could use the DataStorage to get a File-Object from the MP3-File you want to edit and then use a ID3-Tag Library like Jaudiotagger to edit the ID3-Tags. 回答2: From the CLI, you can

How to make range request for any portion of a media fragment?

此生再无相见时 提交于 2019-12-31 03:53:11
问题 If we wanted to make an HTTP/1.0 or HTTP/1.1 request, for example bytes 20000 to 100000 or seconds 20 through 35 seconds of a given media resource for example, .webm or .ogg audio or .mp4 video, where the response would be a discrete media fragment capable of playback without other portions of the media resource, how would we achieve this? For example let headers = new Headers(); let range = 1024 * 1024; headers.append("Range", "bytes=0-" + range); let request = new Request(url, {headers

Get images thumbnail file paths

£可爱£侵袭症+ 提交于 2019-12-30 09:38:52
问题 I'm trying to get the thumnail paths , not the bitmaps objects. When I query for these, some of the thumbnail paths are null for some reason. (I have 1028 thumbnail images in my device, the cursor length is indeed 1028, but still returning nulls) I know there are 1028 thumbnail images because I checked. Here's my code: String[] projection = {MediaStore.Images.Thumbnails._ID}; // Create the cursor pointing to the SDCard cursor = this.getContentResolver().query( MediaStore.Images.Thumbnails

Django upload_to outside of MEDIA_ROOT

别说谁变了你拦得住时间么 提交于 2019-12-29 03:52:11
问题 My deployment script overwrites the media and source directories which means I have to move the uploads directory out of the media directory, and replace it after the upload has been extracted. How can I instruct django to upload to /uploads/ instead of /media/? So far I keep getting django Suspicious Operation errors! :( I suppose another solution might be a symlink? Many thanks, Toby. 回答1: I did the following: from django.core.files.storage import FileSystemStorage upload_storage =

How to target CSS for iPad but exclude Safari 4 desktop using a media query?

两盒软妹~` 提交于 2019-12-28 05:21:13
问题 I am trying to use a media rule to target CSS to iPad only. I want to exclude iPhone/iPod and desktop browsers. I would like to to also exclude other mobile devices if possible. I have used <style type="text/css" media="only screen and (min-device-width: 768px) and (max-device-width: 1024px)"> but just found out that desktop Safari 4 reads it. I have tried variations with "481px" instead of "768px" and another that adds an orientation to that: <style type="text/css" media="only screen and

How to update the Android media database

戏子无情 提交于 2019-12-28 03:50:49
问题 My application shows the list of songs in sdcard, and there is an option to delete the song from SD card. Even when the song is deleted the song still comes in my applications list. How can I update the android media database and show the updated database? 回答1: Android has a cache of sorts that keeps track of media files. Try this: sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory()))); It makes the MediaScanner service run

Flash Whiteboard: Actionscript 3

不羁岁月 提交于 2019-12-25 19:39:28
问题 I'm looking for a flash Actionscript 3 tutorial on how to create a whiteboard application with flash media server 3.5. Please anybody have any ideas where I can start looking for this information? 回答1: Search for the articles: Using the Whiteboard component Creating a Whiteboard Application with Macromedia Flash Communication Server MX My first answer so no link allowed for me 来源: https://stackoverflow.com/questions/904752/flash-whiteboard-actionscript-3