Video Rate on Android—what am I doing wrong?


#1

Hi. I’m trying to get video playing back on Android with a slow rate (such as 0.5). I’ve taken the sample code from the latest docs and simply added rate={0.5}. This works fine in iOS, but on Android it has no effect. I’ve tried on Android 6 and 7, with emulators and devices.

I could have sworn I tried this a few weeks ago in Sketch and it worked. I’ve tried this today in Sketch, in XDE, and with CRNA.

When I log the params from onLoad, it reports “canPlaySlowForward”:true and “canPlayFastForward”:true.

Any help would be greatly appreciated. It’s my first time on the forum, so if I can provide any better/different documentation please let me know!

import Expo, { Video } from "expo";
import React from "react";
import { StyleSheet, View } from "react-native";

class App extends React.Component {
  render() {
    return (
      <View style={styles.container}>
        <Video
          source={{
            uri: "http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4"
          }}
          rate={0.5} // <- no apparent effect
          style={{ width: 320, height: 240 }}
          onLoad={params => {
            console.log(params);
          }}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#fff",
    alignItems: "center",
    justifyContent: "center"
  }
});

Expo.registerRootComponent(App);

#2

What device are you using? and what version of android?


#3

Android 6 on Galaxy S5
Android 7 on Galaxy S8

Also Android 6 and 7 in AVDs via emulator.

Thanks


#4

Hi @rickdt!

It turns out that up to SDK16, setting rate in the Video component does not work on Android devices. We have been working on fixing this and similar bugs and we should have an update for you soon.

Thanks! Let me know if you have any more AV questions.

Greg


#5

Thanks Greg. So, I must have imagined seeing this working on Snack, huh?


#6

No problem! And yeah, I’m not sure how this could have worked in Snack on the Android simulator.

Greg


#7

Hi! I’m having the same problem (version 27 of ExpoKit), has there been a fix for this already?