media

How to serve django media files via nginx ?

半腔热情 提交于 2019-11-28 18:45:48
I'm new at Nginx, I've successfully bound my django project to Nginx. However I can't serve my static files and I guess I set my media folder's location wrongly. Here is my file tree: root_directory my_django_project ... manage.py app1 app2 media admin css js ... And my nginx.conf goes like : server { listen 192.168.1.9:80; server_name localhost; # site_media - folder in uri for static files location /media/ { root /home/nazmi/workspace/portal/media/; } location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov) { access_log off; # po

show/hide div based on browser size using ONLY css?

穿精又带淫゛_ 提交于 2019-11-28 18:22:16
I am a trying to get some divs to show/hide based on browser size, using only css media queries... but nothing seems to be working... please help if you can and let me know what i'm doing wrong... thanks in advance! heres my css.. @media all and (max-width: 959px) { .content .700{display:block;} .content .490{display:none;} .content .290{display:none;} } @media all and (max-width: 720px) { .content .700{display:none;} .content .490{display:block;} .content .290{display:none;} } @media all and (max-width: 479px) { .content .700{display:none;} .content .490{display:none;} .content .290{display

How to shut off the sound MediaRecorder plays when the state changes

◇◆丶佛笑我妖孽 提交于 2019-11-28 17:56:44
问题 My Android application uses MediaRecorder on a SurfaceHolder to show a live preview of what the camera is capturing. Every time the user presses the REC button on the app, the app starts to record. Every time the state of the MediaRecorder switches to/from 'start', Android automatically (?) fires off a beep. This beep sounds different from phone to phone, which makes me think that this beep is natively attached to the state change of MediaRecorder. The beep is not played if the volume of the

android.os.FileUriExposedException: file.jpg exposed beyond app through ClipData.Item.getUri()

谁都会走 提交于 2019-11-28 17:28:25
I try to do a button that open the camera and take picture. my code is here //for imports check on bottom of this code block public class HomeProfileActivity extends AppCompatActivity { //Button camera public static final String TAG = HomeProfileActivity.class.getSimpleName(); public static final int REQUEST_TAKE_PHOTO = 0; public static final int REQUEST_TAKE_VIDEO = 1; public static final int REQUEST_PICK_PHOTO = 2; public static final int REQUEST_PICK_VIDEO = 3; public static final int MEDIA_TYPE_IMAGE = 4; public static final int MEDIA_TYPE_VIDEO = 5; private Uri mMediaUri; private

What does -webkit-min-device-pixel-ratio: 2 stand for?

蹲街弑〆低调 提交于 2019-11-28 17:12:02
问题 @media only screen and (max-device-width:480px), only screen and (-webkit-min-device-pixel-ratio: 2) { /*iphone css*/ } max-device width makes sense but pixel ratio doesn't make any sense to me. thanks. 回答1: From http://developer.android.com/reference/android/webkit/WebView.html The -webkit-device-pixel-ratio CSS media query. Use this to specify the screen densities for which this style sheet is to be used. The corresponding value should be either "0.75", "1", or "1.5", to indicate that the

What is the best way to stream a audio file to website users/listeners [closed]

巧了我就是萌 提交于 2019-11-28 16:15:45
I'm developing a music site which will stream audio files stored in a server to users, audio files will be played through flash player placed in a webpage.. As I heard I need to use a streaming media server for streaming audio files ( like 2mb to 3mb in size).. Do I need to use one? I found some streaming media server softwares like http://www.icecast.org - but as in their documentation, It is used for streaming radio stations and live streaming purposes, but I just need to stream audio files faster and in low size (low bandwidth) with good quality.. I heard I need to encode the audio files

Retrieving and Saving media metadata using FFmpeg

£可爱£侵袭症+ 提交于 2019-11-28 15:52:36
I want to read the metadata in media files and then save that metadata in a text/xml file, so that I can later insert that data in my database. I would prefer to use ffmpeg. Also is the same thing possible with MediaInfo?? I know I can get the metadata for individual tracks using MediaInfo, but I would want to automate it; as in whenever a new media file is found, read its metadata and then store it in a txt/xml file. Or, is there any other tool/utility/API that I can use for this? Dmitry Shkuropatsky You can save the global metadata to a text file using the -f ffmetadata option as follows:

Pre-Select Images when opening WordPress 3.5 media manager

泪湿孤枕 提交于 2019-11-28 15:42:09
问题 I've been playing around with the new media manager in WordPress and had some fun with it, but have reached the point where I'm banging my head against a wall. I have a custom meta box that I'd like to store some images in (well it's a hidden input and I'm currently storing their ID's, but could equally be the image objects), then making an AJAX call to show some thumbnails, which I have subsequently made draggable so users can reorder (not necessarily relevant just some background). My

Convert audio files to mp3 using ffmpeg

你说的曾经没有我的故事 提交于 2019-11-28 13:20:49
问题 I need to convert audio files to mp3 using ffmpeg. When I write the command as ffmpeg -i audio.ogg -acodec mp3 newfile.mp3 , I get the error: FFmpeg version 0.5.2, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: libavutil 49.15. 0 / 49.15. 0 libavcodec 52.20. 1 / 52.20. 1 libavformat 52.31. 0 / 52.31. 0 libavdevice 52. 1. 0 / 52. 1. 0 built on Jun 24 2010 14:56:20, gcc: 4.4.1 Input #0, mp3, from 'ZHRE.mp3': Duration: 00:04:12.52, start: 0.000000, bitrate: 208 kb/s Stream #0.0:

Android MediaPlayer OnPreparedListener

走远了吗. 提交于 2019-11-28 11:13:52
I am working on a simple app and using a MediaPlayer to play some background noise in 1 activity. I am reading up on MediaPlayer and am not sure whether or not to implement an OnPreparedListener to trigger the start() method. What are the pros / cons to each approach? Approach 1: mediaPlayer = MediaPlayer.create(context, R.raw.sound); mediaPlayer.setLooping(true); mediaPlayer.start(); Approach 2: mediaPlayer = MediaPlayer.create(context, R.raw.sound); mediaPlayer.setLooping(true); mediaPlayer.setOnPreparedListener(new OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { mp