I am just getting started with React-Native. Does anyone have any experience getting soundcloud songs to play? I have tried an iframe webview, but I need the song to be playing while surfing through the app. The webview only allows for me to play something while the webview is open.
I am thinking the best way to do this would be to have an invisible iframe webview that never gets refreshed. Is this possible?
I've also tried using the react-native-sound package, however I can't use that to stream from the soundcloud Stream URL.
Does anyone have any ideas/worked with this before?
I would recommend a more native implementation.
There is an Objetive C/Cocoa (iOS) wrapper available that supports the audio streaming. https://github.com/soundcloud/cocoa-api-wrapper
There is also an Android one (it looks like support was discontinued, but still should work) https://github.com/soundcloud/java-api-wrapper
You can wrap those using Native Modules and let the OS handle the playing of the audio. It will work better than some WebView based circumvention.
I have a suggestion.
Use this library for soundcloud api in react-native.
https://github.com/nhayflick/ReactNativeMusic
Related
I am using Cordova to create an APK.
The Android WebView does not allow scrubbing of HTML5 video.
Is possible to open my app's video in Android's Native Video Player.
The HTML is simple:
<video src="video.mp4"></video>
For the scrubbing issue, I have tried to render the video as an iframe and embedded element but neither have worked.
I have also tried to invoke JS commands on the video. While these work in my browser, they do not work when exported to an APK.
I have also researched related SO posts but found no solidifying answers.
How would you make a call to another app on the device?
I read about using Intent but that appears to be a Native solution, such as developing the app in Android Studio.
you will have to use cordova-plugin-media.
read this documentation https://cordova.apache.org/docs/en/11.x/reference/cordova-plugin-media/index.html
additionally you can also use any freely available jquery media player plugins
for eg. https://videojs.com/
So I've been battling with an issue for a while now, I've been trying to get the audio playing through the speakers of a device using the MediaDevices singleton object in javascript.
I'm trying to achieve something similar to Shazam or snapchat where they can both get the audio playing from the speakers of a device and also from a microphone so that I can for instance be taking a video using my microphone and video cam and also streaming the sound playing from the background.
I'll like to know if this is possible because I tried using devices with kind of "audiooutput" and deviceId of "default" accessible through the enumerateDevices method assuming that's the device's output speaker but I still get the audio from the microphone even when using the device kind of "audiooutput".
Note: I'm able to combine multiple audio nodes successfully.
I'm not asking for a do it for me answer, just a theory of how to go about implementing it if it's possible in javascript.
Thanks in advance :D
No, this isn't possible via the Web Audio API. Not all platforms even support this capability.
On some platforms, you can use getDisplayMedia() and get audio with it, but compatibility isn't great right now.
So currently I am developing an application that I'd of hoped to work on Windows, Xbox, etc.
I am trying to developer a wrapper for a javascript library that plays music. This library does not exist in any other form, and only provides the music as encrypted files. It handles playing the audio, pausing, fetching, etc. To change anything you call js methods.
So I am currently using a hidden UWP webview, with custom js/html to play and pause the audio coming from the js library. I was fiddling around with it and noticed if I minimized it, the audio is stopped from the webview. I cannot set a media source for a backgroundtask as I cannot get the actual source of the audio. That is all handled by the js library.
I am hoping to find a way to use UWP, along with this webview "hack". Am I trying to accomplish the impossible?
After few days of investigation, i still got no luck on this issue, thanks in advance if you can help me out!
i am using cordova 3.3 to do my iOS app, one feature is to play an audio clip from a URL.
I am using cordova's offical media api, here is how i use it following their offical examples
var myMedia = new Media("http://123.com/xyz.mp3");
myMedia.play()
here is the issue: when the play event is fired, the UI freeze a few seconds,
I believe this is due to fetching a remote resource from http://123.com/xyz.mp3, when play a mp3 locally, there is no such issue.
the media api seems do not offer preload kinda function.
when loading the remote url mp3, it is using the same thread as the UI therefore it freeze until the loading task is done....
does anyone experience the similar problem? how should fix this issue?
Thank you very much for you time :)
We're currently developing an app that streams some music and we had the exact same problem.
We decide to go with the HTMLAudioElement. You can use it just like this
var myAudio = new Audio("http://123.com/xyz.mp3");
myAudio.play();
This doesn't freeze our UI while loading and I even think it loads a little bit faster.
And it's also working in the browser, which is nice for testing.
The down side is, that Android doesn't support the HTML5 Media API and has some general problems with the Audio Element as well (in some versions on some devices). So if you want to support Android you probably better use the Phonegap Media API there.
I'm trying to find a solution for my website which desperately needs an upgrade. Currently I am using Flash-based players to stream content from Shoutcast, which doesn't work too terribly, but unfortunately it leaves mobile users behind.
Ideally, I would love to have an HTML5/Javascript player that can play Shoutcast (or other) streams online. I've tried jPlayer, which seems pretty good for playing individual files, but have been unsuccessful in trying to get it to work with Shoutcast and Icecast.
Does anybody have any suggestions on where to start?
You can use jPlayer to play your shoutcast stream using HTML5 native player - it works quite well on most browsers/platforms except android. In that case jPlayer provides the flash player backup.
You need to specify your type of audio as 'mp3' (aac streams do not work so make sure you are specifying a straight icy mp3 stream) I have used 'mp3' but you can also try type 'stream'
You need to change the url of your stream slightly:
Normal: http://yourserver.com:8000/listen.pls
jPlayer: http://yourserver.com:8000/;listen.pls
(note the addition of the semicolon - this helps with shoutcast servers)
Here is the documentation from the jPlayer site that should help as well.
http://www.jplayer.org/latest/demo-08/
Happy Streaming!