有没有办法在手机入睡时播放抽搐音频而不会有用户互动的方法?
- 首先,我知道这是侵入性的,我正在尝试发出警报 -
我正在寻找一个设置一个警报的Android应用程序,该应用程序将播放Twitch Audio而无需用户互动。对于警报部件,我使用 armardmanager 但是,当警报触发时,我正在努力在锁定的电话屏幕上进行Twitch进行自动播放。
我对如何执行此操作的两个主要想法(在Android上)是:
IDEA#1:嵌入Twitch Player在网页中,当警报触发时在锁屏上显示: twitch嵌入 全屏意图 但是,玩家静音了,我无法找到解决这个问题的方法(似乎没有得到支持) [类似的问题#1] https://discuss.dev.twitch.tv/t/i------------------------mute-unmute-unmute-video-clips-clips-in-twitch-preview/31585 [类似的问题2] https ///discuss.dev.twitch.tv/t/how-to-unmute-clips-on-load/26054/2
创意#2:只需在锁定屏幕时使用Twitch应用程序启动流。目前,我是如何启动YouTube音频流的方式,并且在手机被锁定在后台时会启动。我知道在Twitch Android应用程序中有一些功能,因为能够通过在流中更改设置而在没有应用程序打开的情况下播放流。但是,目前,如果我尝试在屏幕锁定时使用Twitch启动流,据我所知,在用户打开手机之前,视频不会加载。
是的,有没有一种方法可以在手机入睡时在没有用户互动的情况下播放抽搐音频?
谢谢
--First off I am aware this is invasive, I'm trying to make an alarm--
I'm looking to create an Android app that sets an alarm which will play Twitch audio without any interaction from the user. For the alarm part I'm using AlarmManager
However I am struggling to get twitch to autoplay on the locked phone screen when the alarm triggers.
My two leading ideas for how to do this (on Android) are:
Idea#1: Embed twitch player in a webpage that is shown on the lockscreen when the alarm triggers:
Twitch Embed
Fullscreen intent
However the player is muted and I haven't been able to find a way around this (and doesn't seem like it is supported)
[Similar issue #1]https://discuss.dev.twitch.tv/t/i-am-unable-to-mute-unmute-video-clips-in-twitch-preview/31585
[Similar issue #2]https://discuss.dev.twitch.tv/t/how-to-unmute-clips-on-load/26054/2
Idea #2: Just launch a stream using the Twitch app while the screen is locked. This is currently how I am starting a stream for Youtube audio and it launches while the phone is locked in the background fine. I know there is some functionality for this in the Twitch android app due to being able to play streams without the app open by changing settings in a stream. However currently if I try to launch a stream using Twitch while the screen is locked, as far as I can tell the video doesn't load until the user opens the phone.
So yeah, Is there a way to play Twitch audio without interaction from the user when the phone is asleep?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我设法使用解决方案#1(使用Android WebView的全屏意图)解决此问题。但是,我没有嵌入本机Twitch播放器,而是使用Android WebView直接打开Twitch网站。使视频未静音的重要部分是设置 flag to false。代码在下面
``
``
I managed to solve this using solution #1 (Fullscreen intent with android webview). However instead of embeding the native twitch player, I used android webview to open the twitch website directly. The important part to make the videos not muted was to set the mediaPlaybackRequiresUserGesture flag to false. Code is below
`
`