Closed j3rin closed 7 years ago
You don't have the device muted or hooked to any Bluetooth setup eh?
Sent from my iPhone
On Mar 20, 2017, at 6:33 PM, j3rin notifications@github.com<mailto:notifications@github.com> wrote:
Please help, audio is not working on iPhone but works on emulator.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/itsnubix/react-native-video-controls/issues/20, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APBvPTNseblZ2HhW3kooXRudJXAMXadkks5rnxrkgaJpZM4MjMF6.
Nope, tried on two different iPhones same issue.
Can you send me the code on how you're using the package? What version of RN are you on?
Sent from my iPhone
On Mar 20, 2017, at 6:35 PM, j3rin notifications@github.com<mailto:notifications@github.com> wrote:
Nope, tried on two different iPhones same issue.
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/itsnubix/react-native-video-controls/issues/20#issuecomment-287940938, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APBvPaTYNJ09hbgc1MJCUUJY1cJNf7Ieks5rnxtZgaJpZM4MjMF6.
Also, what kind of devices are you running? Which version of iOS?
Sent from my iPhone
On Mar 20, 2017, at 6:35 PM, j3rin notifications@github.com<mailto:notifications@github.com> wrote:
Nope, tried on two different iPhones same issue.
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/itsnubix/react-native-video-controls/issues/20#issuecomment-287940938, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APBvPaTYNJ09hbgc1MJCUUJY1cJNf7Ieks5rnxtZgaJpZM4MjMF6.
Running react-native-cli: 0.1.10 react-native: 0.42.0
Emulator iPhone 6
Device iPhone 7 Plus 10.2.1 iPhone 6
Package JSON File "dependencies": { "axios": "^0.15.3", "native-base": "^2.0.13", "react": "15.4.2", "react-native": "^0.42.0", "react-native-elements": "^0.10.0", "react-native-image-slider": "^1.1.5", "react-native-material-buttons": "^0.2.0", "react-native-md-textinput": "^2.0.4", "react-native-video": "^1.0.0", "react-native-video-controls": "^1.1.1" },
Code Below import React, { Component} from 'react'; import { AppRegistry, StyleSheet, Text, View, StatusBar, KeyboardAvoidingView, TabBarIOS, Image } from 'react-native'; import { Container, Content, Card, CardItem, Tabs, Tab, Left, Body,Thumbnail,Footer, FooterTab, Button, Icon } from 'native-base';
import VideoPlayer from 'react-native-video-controls'; export default class Test extends Component {
render() {
return (
<View style={styles.ViewContainer}>
<VideoPlayer
source={{ uri: 'https://vjs.zencdn.net/v/oceans.mp4' }}
navigator={ this.props.navigator }
/>
</View>
);
}
} const styles = StyleSheet.create({ ViewContainer: { flex: 1, flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'stretch', backgroundColor: '#fff', }, loginView: { alignItems:'center', flexGrow:1, justifyContent: 'center', }, header:{ height: 70, backgroundColor: '#e74c3c', paddingTop:30, shadowColor: '#aaa', shadowOpacity: 1, }, headerTitle:{ color:'#fff', fontSize: 20, alignItems:'center', justifyContent: 'center', }, image:{ flex:1, height:200 }, slider:{ flex:1, flexDirection: 'row', height:200 }, card:{ padding:0, margin:0 }, info:{ padding:20 }, title:{ fontWeight:"bold" } });
Thank you for your help
No problem....gimme a bit to play around with this and build out a few tests.
Figured it out, my ringer was on mute on the iPhone. how can overide this because instagram and other applications audio worked.
D'oh.
For playing while muted: https://github.com/react-native-community/react-native-video/issues/531
When I built this a few months back there were a few things that didn't quite work well with RN Video 0.9...example: +/- buttons on the side also don't fully respond to the volume either. I'm a little busy these days but am planning on doing an overhaul to this package...need to update the RN version it uses as well as a couple more features that'd be nice to have (such as your play audio while muted bit).
Thank you so much, really appreciate it!
Sorry, but where do i add this. Im new to mobile development. forgive my ignorance.
do { try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, with:AVAudioSessionCategoryOptions.mixWithOthers) print("AppDelegate: [AVPlayer] setCategory to Playback") do { try AVAudioSession.sharedInstance().setActive(true) print("AppDelegate: [AVPlayer] activate ") } catch let error as NSError { print("AppDelegate: Warning [AVPlayer] setCategory failed with error (error)") } } catch let error as NSError { print("AppDelegate: Warning [AVPlayer] failed to change category: (error)") }
No problem. You add it in your AppDelegate.m file.
In your app file go into the ios folder and open the .xcodeproj file
In the tree view you'll see your project...open that and then the folder with your project name and you'll see AppDelegate.m.
That said, that code is Swift so you'll need to change it to Obj-C if you're going to place it directly into your delegate file.
http://stackoverflow.com/questions/31309249/how-to-convert-objective-c-appdelegate-to-swift
Last question lol, How do I convert swift code to Obj-C. Thanks a million!
Wait Got it. This works!
NSError setCategoryErr = nil; NSError activationErr = nil; [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&setCategoryErr]; [[AVAudioSession sharedInstance] setActive:YES error:&activationErr];
Excellent. Good luck out there.
Please help, audio is not working on iPhone but works on emulator.