matvp91 / shaka-player-react

A simple React component wrapper for shaka-player
MIT License
110 stars 34 forks source link

Does this work with renative ? #6

Open redgoalsuk opened 4 years ago

redgoalsuk commented 4 years ago

Hi

I am trying to get a player that will work with renative https://github.com/pavjacko/renative

I cam across this player and tried to run the sample code but it did not play on a Samsung Tizen TV 2016 - I just get a blank page, it works fine when I play it on the desktop with no errors in the js console.

Any ideas what I may be doing wrong here or is this player not intended for native applications?

import React, { Component } from "react";
import ReactDOM from 'react-dom';
import ShakaPlayer from 'shaka-player-react';

const STREAMS = [
  {
    name: 'Angel One MPEG-DASH',
    src: 'https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd',
  },
  {
    name: 'Big Buck Bunny HLS',
    src:
      'https://storage.googleapis.com/shaka-demo-assets/bbb-dark-truths-hls/hls.m3u8',
  },
];

function App() {
  const [show, setShow] = React.useState(false);

  function onToggle() {
    setShow(!show);
  }

  const [src, setSrc] = React.useState(STREAMS[0].src);

  function onSelectSrc(event) {
    setSrc(event.target.value);
  }

  return (
    <div>
      <div>
        <button onClick={onToggle}>{show ? 'Hide' : 'Show'}</button>
      </div>
      <div>
        <select value={src} onChange={onSelectSrc}>
          {STREAMS.map(stream => (
            <option value={stream.src}>{stream.name}</option>
          ))}
        </select>
      </div>
      {show && <ShakaPlayer autoPlay src={src} />}
    </div>
  );
}
export default App;
matvp91 commented 4 years ago

Would you mind attaching a debugger to Tizen to figure out if either Shaka or the React wrapper throws an error? I'd like to figure out if this could be an issue in the React wrapper or in shaka-player itself. As far as I know, support for Tizen 2016 is untested by the shaka team but could theoretically work.

bruno-sartori commented 2 years ago

Someone knows more about this?