Android,如何在我从相机捕捉视频时播放歌曲?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10291826/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android, How to Play song while i'm capturing video from camera?
提问by Hesam
when user clicks a button i nee to direct him to a page which it has list of songs. Then when an items selected by user the i need to play song and let him to capture movie together. Its something like karaoke.
当用户单击一个按钮时,我需要将他定向到一个包含歌曲列表的页面。然后当用户选择一个项目时,我需要播放歌曲并让他一起捕捉电影。它有点像卡拉OK。
Is it possible? please tell me how can i find a reference?
是否可以?请告诉我如何找到参考?
Thanks
谢谢
采纳答案by Ilya Gazman
Yes it is possible, I can tell because my cam playing button click sound when I am recording. I don't think you need a service for that, just try using MediaPlayer
是的,这是可能的,我可以说是因为我的摄像头播放按钮在我录制时发出咔哒声。我认为您不需要为此提供服务,只需尝试使用MediaPlayer
回答by Raj Shah
Use of service will help in this case. For this you need to create two services, one for recording video and other for playing music. Through your main activity control both.
在这种情况下,使用服务会有所帮助。为此,您需要创建两项服务,一项用于录制视频,另一项用于播放音乐。通过您的主要活动控制两者。
I hope it solve the work. But as per the devices seen like samsung devices, they dont provide this functionality. When camera recording is done, you cant play music.
我希望它能解决工作。但是根据看起来像三星设备的设备,它们不提供此功能。相机录制完成后,您无法播放音乐。
Logically using service we can do the task.
逻辑上使用服务我们可以完成任务。
Let me know if it works :)
让我知道它是否有效:)