我试图根据浏览器大小显示/隐藏一些div,只使用css媒体查询...但似乎没有任何工作......请帮助,如果可以,让我知道我做错了什么. .. 提前致谢!
继承人我的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:block;}
}
Run Code Online (Sandbox Code Playgroud)
这是我的HTML
<div class="content">
<div class="700">this is the content for desktop</div>
<div class="490">this is the content for tablet</div>
<div class="290">this is the content for mobile</div>
</div>
Run Code Online (Sandbox Code Playgroud) 在不使用外部库的情况下,确定给定mp3文件的长度(以秒为单位)的最简单方法是什么?(蟒蛇来源高度赞赏)
我已成功为普通的MEDIA文件提供媒体文件,但当我尝试提供管理媒体文件时,我失败了.请帮助我找到问题所在,因为我已经尝试解决问题好几个小时已经没有运气了(谷歌搜索也读了django doc关于提供静态文件).
我尝试访问localhost:8000/media/a.gif时的错误如下:
页面未找到:f:\ python25\lib\site-packages\django/contrib/admin/media\a.gif
我将管理媒体文件放在名为"media"的目录中,而我将普通媒体文件放在名为"static"的目录中.我也在Windows上.
以下是我在urls.py中提供普通媒体文件的方式:
# serve static files
from django.conf import settings
if settings.ENVIRONMENT==settings.ENV_DEVELOPMENT:
urlpatterns += patterns("django.views",
url(r"%s(?P<path>.*)$" % settings.MEDIA_URL[1:], "static.serve", {"document_root": settings.MEDIA_ROOT,})
)
Run Code Online (Sandbox Code Playgroud)
还有我的settings.py(只有重要部分):
import project_path
MEDIA_ROOT = project_path.MEDIA.replace('\\','/')
MEDIA_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/media/'
TEMPLATE_DIRS = (
project_path.TEMPLATE.replace('\\','/'),
)
Run Code Online (Sandbox Code Playgroud)
我的project_path.py:
import sys
from os.path import dirname, join
ROOT = dirname(__file__)
APP = join(ROOT, "apps")
TEMPLATE = join(ROOT, "templates")
MEDIA = join(ROOT, "static")
ADMIN_MEDIA = join(ROOT, "media")
Run Code Online (Sandbox Code Playgroud)
任何提示?
或者至少请分享您如何提供管理媒体文件(不更改来自Web服务器的任何文件,但只能通过django源代码)
提前致谢 :)
我想为android创建简单的均衡器.我该怎么做?
尝试在MediaPlayer类中找到一些方法.但我所有的尝试都失败了.
我使用ckeditor的media embed插件.它工作正常,代码正确保存在数据库和youtube,soundcloud等.玩家在页面上显示确定.但是当用户进入他的管理,他可以编辑信息时,内部和标签中的文本没有显示,因此当用户点击保存按钮时,所有先前保存的iframe将被"删除"而只有其他将保存格式化文本.有没有办法在ckeditor中显示iframe代码?
我需要一个可以处理常见媒体格式的媒体信息提取库(纯Java或JNI包装器).我主要将它用于视频文件,我至少需要这些信息:
有几个库和工具,但我找不到Java.
我试图在Android上获得麦克风的振幅水平,如下所示:
MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
Timer timer = new Timer();
timer.scheduleAtFixedRate(new RecorderTask(recorder), 0, 1000);
private class RecorderTask extends TimerTask {
private MediaRecorder recorder;
public RecorderTask(MediaRecorder recorder) {
this.recorder = recorder;
}
public void run() {
Log.v("MicInfoService", "amplitude: " + recorder.getMaxAmplitude());
}
}
Run Code Online (Sandbox Code Playgroud)
不幸的是,这只会一直返回0.
看来为了实现这一点,我必须真正开始录制.那是对的吗?
如果是这样,我是否需要录制500ms,获得振幅,停止录制并重复?
最后,我是否必须录制到文件?我不需要保存这个音频文件,我不能只是获取当前幅度或自上次调用当前直播麦克风输入以来没有录音的最高幅度?
任何帮助表示赞赏,谢谢.
如何从现有的URI中保存媒体文件(比如.mp3),这是我从隐含意图获得的?
我试图通过缺乏不同的描述来实现离线媒体上下文.
这个概念是创造1秒Blob
的录制媒体,具有的能力
Blobs
独立播放1秒HTMLMediaElement
Blob
s 播放完整的媒体资源问题是,一旦Blob
s被连接起来,媒体资源就不会HTMLMedia
使用a Blob URL
或者在元素上播放MediaSource
.
创建的Blob URL
只播放连接Blob
的1秒.MediaSource
抛出两个例外
DOMException: Failed to execute 'addSourceBuffer' on 'MediaSource': The MediaSource's readyState is not 'open'
Run Code Online (Sandbox Code Playgroud)
和
DOMException: Failed to execute 'appendBuffer' on 'SourceBuffer': This SourceBuffer has been removed from the parent media source.
Run Code Online (Sandbox Code Playgroud)
如何正确编码连接的Blob
s或以其他方式实现变通方法以将媒体片段作为单个重组媒体资源播放?
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
const src = "https://nickdesaulniers.github.io/netfix/demo/frag_bunny.mp4";
fetch(src)
.then(response => response.blob())
.then(blob => …
Run Code Online (Sandbox Code Playgroud) 我需要支持Jersey REST上的简历,我试图这样做:
@Path("/helloworld")
public class RestServer {
@GET
@Path("say")
@Produces("audio/mp3")
public Response getMessage(@HeaderParam("Range") String r ) throws IOException{
String str="/Users/dima/Music/crazy_town_-_butterfly.mp3";
System.out.println(r);
RandomAccessFile f=new RandomAccessFile(str, "r");
int off=0;
int to=(int)f.length();
byte[] data ;
if(r!=null){
String from=r.split("=")[1].split("-")[0];
String t=r.split("=")[1].split("-")[1];
off=Integer.parseInt(from);
to=Integer.parseInt(t);
}
data= new byte[to-off];
f.readFully(data, off, to-off);
ResponseBuilder res=Response.ok(data)
.header("Accept-Ranges","bytes")
.header("Content-Range:", "bytes "+off+"-"+to+"/"+data.length)
.header("Pragma", "no-cache");;
if(r==null){
res=res.header("Content-Length", data.length);
}
f.close();
Response ans=res.build();
return ans;
}
}
Run Code Online (Sandbox Code Playgroud)
我希望能够流式播放MP3,以便浏览器可以搜索音乐,但在Safari中它仍然无法正常工作.有任何想法吗?