无内容UrI的访问邮件收件箱(内容//:短信)(Access message inbox without Content UrI (content//:sms))
我想通过我的android项目访问存储在收件箱中的消息。 我已经尝试了为sms形成URI的方法(内容:// sms / inbox),然后针对各种参数进行查询。
但我在标准的Android Developr Docs中找不到任何有关阅读收件箱短信的文档。 在各个网站上都提到这个内容已从标准sdk中删除。 该应用程序可能不支持更高版本的Android。
那么,我怎样才能创建一个应用程序来从收件箱中读取sms,这在未来版本的android中是可靠的。
请帮忙 !!
I want to access the messages stored in inbox through my android project. I have tried the method of forming URI for sms (content://sms/ inbox) and then quering it for various parametres.
But I cannot find any documentation for reading inbox sms in the standard Android Developr Docs. It was mentioned at various websites that this content has been removed from the standard sdk. The application may not support higher version of android.
So, how can I create an apllication to read sms from inbox that is reliable in furture version of android.
Please help !!
原文:https://stackoverflow.com/questions/3046215
最满意答案
你在
playvid()
函数中有vidseek()
和seektimeupdate()
。 看下面的代码:var myvideo = document.getElementById("myvideo") var button = document.getElementById('button') var seekslider = document.getElementById('vidtime'); var isplaying = false; function playvid() { if (isplaying==false) { myvideo.play(); button.innerText="Pause" isplaying=true; } else { myvideo.pause(); button.innerText="Play" isplaying=false; } } /* vidseek() and seektimeupdate() should live outside of playvid() function */ function vidseek() { var seekto = myvideo.duration * (seekslider.value / 100); myvideo.currentTime = seekto; } function seektimeupdate() { var nt = myvideo.currentTime * (100 / myvideo.duration) seekslider.value=nt; } setInterval(seektimeupdate,10,false) seekslider.addEventListener("change",vidseek,false)
body { background-color: #42b0f4; } #videocontrols { width:250px; background-color: #8c93a5; padding: 2px; text-align: left; } #myvideo { align-self: center; background-color: #e2eaff; width: 250px; padding: 2px; } #vidtime { width: 100px; }
<!DOCTYPE html> <html> <head> </head> <body> <video src="https://www.w3schools.com/html/mov_bbb.mp4" id="myvideo"></video> <div id="videocontrols"> <font color="#8c93a5">cv</font><button id="button" onclick="playvid()" height="25">Play</button><input type="range" id="vidtime" value="0" min="0" max="100"> </div> </body>
You had
vidseek()
andseektimeupdate()
withinplayvid()
function. Look at the code below:var myvideo = document.getElementById("myvideo") var button = document.getElementById('button') var seekslider = document.getElementById('vidtime'); var isplaying = false; function playvid() { if (isplaying==false) { myvideo.play(); button.innerText="Pause" isplaying=true; } else { myvideo.pause(); button.innerText="Play" isplaying=false; } } /* vidseek() and seektimeupdate() should live outside of playvid() function */ function vidseek() { var seekto = myvideo.duration * (seekslider.value / 100); myvideo.currentTime = seekto; } function seektimeupdate() { var nt = myvideo.currentTime * (100 / myvideo.duration) seekslider.value=nt; } setInterval(seektimeupdate,10,false) seekslider.addEventListener("change",vidseek,false)
body { background-color: #42b0f4; } #videocontrols { width:250px; background-color: #8c93a5; padding: 2px; text-align: left; } #myvideo { align-self: center; background-color: #e2eaff; width: 250px; padding: 2px; } #vidtime { width: 100px; }
<!DOCTYPE html> <html> <head> </head> <body> <video src="https://www.w3schools.com/html/mov_bbb.mp4" id="myvideo"></video> <div id="videocontrols"> <font color="#8c93a5">cv</font><button id="button" onclick="playvid()" height="25">Play</button><input type="range" id="vidtime" value="0" min="0" max="100"> </div> </body>
相关问答
更多-
确保您的Web服务器能够使用字节范围提供文档。 谷歌浏览器要求这样做。 没有它,搜索将被禁用,并且设置currentTime将不起作用。 要测试您的Web服务器是否执行此操作,请使用以下命令: curl --dump-header - -r0-0 http://theurl 响应状态必须读取206 Partial Content ,您应该只接收资源的第一个字节,而不是整个资源。 -Phil Make sure your web server is capable of serving the docume ...
-
一般来说,数字不是退出,但你可以假设一个数字,如3,5等,当缓冲时间减去视频的当前时间大于3或5时,视频将顺利播放,否则,视频将处于缓冲阶段,并且它会摇晃,播放不顺畅。代码如下: if(window.video.buffered.length !== 0){ // assume the user have not use the progress bar to control the play progress of the video, so there is only an element in bu ...
-
Javascript - `$(“[href * ='video']”)的意思(Javascript - meaning of `$(“a[href*='video']”)`)[2023-01-06]
$("a[href*='video']") 它是一个包含选择器的jQuery 属性 。 这将返回所有链接元素的Array ,其href包含链接中的video 。 像这个链接包含网址中的视频..所以,它将被选中。 $("a[href*='video']") It's a jQuery attribute contains selector. This will return Array of all links ele ... -
我的问题有2个答案: 视频文件的编码 - 基本上通过控制关键帧并将正确的视频发送到正确的浏览器,我能够解决许多问题。 使用FFMPEG我改变了GOP长度。 在我的情况下, ffmpeg -g
,其中 是所需GOP点之间的帧数。 使用videojs提供视频似乎解决了很多问题,使其体验更加顺畅。 There were 2 answers to my question: Encoding of the video files - basically by controlling k ... -
timeupdate事件发生在音频/视频播放位置改变时。 例。 视频正在播放时。 每当播放视频时,此函数message_one总是每次(秒)调用。 我会给你举例一步 currentTime = 1秒 调用message_one函数 message_one元素不包含类“message_hide” message_one元素添加类“message_hide” currentTime增加到2s 调用message_one函数 message_one元素现在包含“message_hide”类。 message_on ...
-
video.play()不起作用吗? function Fwd(){ var video = document.getElementById("video"); if (video.currentTime < 17.91 && video.currentTime >= 0) { (video.currentTime = 17.92) } else if (video.currentTime < 35.93 && video.currentTime > ...
-
在用户离开或关闭页面之前保存HTML5视频currentTime(Save HTML5 video currentTime before user leaves or closes page)[2023-07-25]
有多种方法可以保存这些东西: 本地(针对同一域) beforeunload 如果您愿意,这可以让您取消卸载事件。 但是,弹出窗口是可选的。 卸下 此事件无法取消,但您仍可以完全访问所有节点和JavaScript变量。 因此,如果不需要取消,您可以进行最终清理/保存。 您可以使用您喜欢的任何保存方法,例如document.cookie或window.localStorage 。 window.onunload = function () { window.localstorage[myVideo.cu ... -
你在playvid()函数中有vidseek()和seektimeupdate() 。 看下面的代码: var myvideo = document.getElementById("myvideo") var button = document.getElementById('button') var seekslider = document.getElementById('vidtime'); var isplaying = false; function playvid() { if ...
-
即使我等到loadmetadata事件到达,但结果是缺乏对web.py的HTTP字节范围请求的支持,这阻止了搜索。 HTTP字节范围请求需要在HTML5视频中进行搜索,而事实证明web.py不支持它们,因此我使用Apache提供视频,并且它运行完美无瑕。 谢谢您的反馈! Even though I was waiting until the loadedmetadata event was reached, it turned out to be the lack of support for HTTP b ...
-
使用timeupdate事件 当前播放位置发生变化时触发*播放期间,每15-250毫秒触发一次,具体取决于所使用的播放技术。 var myPlayer = videojs('videoPlayer'); myPlayer.on('timeupdate', function() { console.log(this.currentTime()); }); Use timeupdate event Fired when the current playback position has changed * ...