var options = {
width : '100%',
height : '100%',
control : true,
autoplay : true
};
player = new Twitch.Player("player", options);
player.addEventListener(Twitch.Player.READY,function(event) {
player.setVideo(id.toString());
});
It’s wired that one is working and the other tablet is not working.
Error message:
Uncaught InvalidStateError: Failed to execute ‘appendBuffer’ on ‘SourceBuffer’: The HTMLMediaElement.error attribute is not null.
player-core-min.js:1 SafeMediaSource update error: DOMException: Failed to execute ‘appendBuffer’ on ‘SourceBuffer’: The HTMLMediaElement.error attribute is not null.
at Error (native)
at n._processUpdates (http://cvp.twitch.tv/1.8.8/player-core-min.js:1:860895)
Weird I tried something similar and it worked fine for me. You don’t really need to listen to an event, you can set a video id in the options using video parameter.
In the example below just replace the channel with video and put the value as the video id and it should work fine.
<script src= "http://player.twitch.tv/js/embed/v1.js"></script>
<div id="player"></div>
<script type="text/javascript">
var options = {
width: '100%',
height: '100%',
channel: 'lirik'
};
var player = new Twitch.Player("player", options);
</script>
Don’t need to worry about the video id. It’s nothing to do with this because if it was you won’t be able to load this on one of the tablets.
You said you are using a webview on android. You can set a client for the webview and also enable JavaScript, do you do this? It could be that for one of the devices the settings default to something that works and on the other device the settings are different.
videoWebView.getSettings().setJavaScriptEnabled(true);
videoWebView.getSettings().setDomStorageEnabled(true);
videoWebView.setWebChromeClient(bla bla bla);
That’s what I am thinking. Except for javascript enabled or Internet Stuffs, what else do we need to enable?
You will have to read through the documentation at http://w3c.github.io/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end
Try to free up the buffer and appending new content to it and see if that work.