Comments (19)
I'm all for supporting audio, but consider that audio does not require any display. So this raises the question of what it should look like if there's no video track.
from react-native-video.
Well it wouldn't display anything I guess. Right now you won't see anything. So you could just create a style which sizes the player to a height of 0. And then you'd just add you own custom controls to interface with it. How does that sound?
from react-native-video.
Or we could allow the user to pass in a static image, which gets displayed while playing the file. But I think not displaying anything should work for now
from react-native-video.
Yes, I think not displaying anything for now is the way to go. And I think
let's also assume custom controls as well. Player controls that make
everybody happy are hard/impossible to get right, and people almost always
want to customize them.
On Thu, Apr 9, 2015 at 11:28 AM, Johannes Lumpe [email protected]
wrote:
Or we could allow the user to pass in a static image, which gets displayed
while playing the file. But I think not displaying anything should work for
nowβ
Reply to this email directly or view it on GitHub
#13 (comment)
.
from react-native-video.
So does it make sense to have the audio be combined with video?
I think for someone looking to use this module, a simple default controls setup would go a long way. Then, could give the ability to customize their own layout.
I'm thinking of a use case where I have ~20 of mp3 URL strings I would want to pass to this component. Then, I could play/pause the current track and go back and forth throughout the array of URL's to listen.
What do you guys think?
from react-native-video.
@mjw56 - agreed that this would be very useful, what would the ideal API for that look like to you? eg: <Audio tracks={this.state.tracksArray} />
?
from react-native-video.
@brentvatne hey, yeah I was thinking of passing in an array. I guess it could accept a single string too and just convert that to an array?
What do you think?
from react-native-video.
We could maybe call it playlist
?
from react-native-video.
Also @mjw56 I don't see any issue why we shouldn't merge audio and video into a single component
because the underlying AVPlayer can take care of both and the default controls should also be applyable to both media types.
from react-native-video.
Ok, would it potentially look something like this?
var Media = require('react-native-media');
var { Audio, Video } = Media;
from react-native-video.
@mjw56 - I like that
from react-native-video.
@mjw56 - definitely something to consider going forward, we are going to focus on getting the Video
component working great and then look at this again. Something like <Media>
element or <Audio>
<Video>
could work, we'll just have to see.
from react-native-video.
Closing this, discussions will continue in #14 π π π―
from react-native-video.
Ok, btw right now I am doing it where I handle the successive playbacks from the component level. I have the playlist track data in a flux store which I can then query from when a song ends, skip track, etc. This approach is working really nicely. It would be nice though to have playlist support in the future. Overall this component works great for handling .mp3 url's. :) I need to test it out some more using some other audio file types.
from react-native-video.
@mjw56 I attempted to upload a .mp3 into my project with no luck, I can only use mp4s. How did you manage to get mp3s to work?
from react-native-video.
@csakon I'm currently only using mp3's loaded from URL's. I haven't tried with mp3 files from disk yet. I don't see why that shouldn't work though?
from react-native-video.
@mjw56 mp3 files from disk don't work, a red react native error pops up saying something about expecing an mp4 at the src. However, I found an iOS app that will let you export audio into mp4 and that works like a charm. I also learned that the names for the uri are case sensitive.
from react-native-video.
@mjw56 can you share a gist with an example to load mp3(s) from an external url?
from react-native-video.
@mjw56 @csakon I've had the same problem with loading mp3's from disk. Doesn't work. Bit of a shame, as mp4 increases the file size.
Curious why this would work with a url but not locally... Any ideas?
from react-native-video.
Related Issues (20)
- [BUG]:v6 beta donβt load mp4 HOT 3
- [BUG]: v6 don't load Internet source mp4 style file,but local source mp4 and other file style can be loaded HOT 2
- Offline DRM support
- [BUG]: How do i import react native video in swift file (iOS native side) HOT 6
- [BUG]: multi audio selection HOT 2
- [BUG]: In iOS, seek is working perfect in portrait mode but when i rotate my device in landscape then on seek i am getting JSON value '0' of type NSNumber cannot be converted to NSDictionary HOT 7
- [Feature]: Privacy Manifest for Promises SDK HOT 3
- [BUG]: shutterColor not typed in Typescript HOT 3
- [BUG]: AVFoundationErrorDomain on iOS when playing .mp3 file HOT 4
- The screen turns off in fullscreen mode HOT 6
- [BUG]: codepush + RNV6, TypeError: Cannot read property 'ScaleAspectFill' of undefined HOT 3
- [Feature]: Improve error typing and management for entire react-native-video package HOT 2
- [BUG]: React Native Video Player Crashes on iOS and Apple TV with Invalid URL HOT 4
- [BUG]: After 5 to 6 seek operations the player frames starts to lag and flick.
- [BUG]: Ios single video making or repeating multiple sound HOT 5
- [BUG]: video continues playing when app goes to the background or navigate to another page HOT 5
- [Feature]: Add ability to show/hide subtitles while still selecting a text track. HOT 5
- [INFRA]: Github Action Cache
- [BUG]: native volume controller is broken when layout direction is rtl HOT 9
- Crash on iOS: com.apple.audio.IOThread.client crash using with Flatlist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-video.