File tree 4 files changed +18
-4
lines changed
4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ var EventEmitter = require('eventemitter3');
2
2
var cloneDeep = require ( 'lodash.clonedeep' ) ;
3
3
var deepFreeze = require ( 'deep-freeze' ) ;
4
4
var selectVideoImplementation = require ( './selectVideoImplementation' ) ;
5
+ var platform = require ( '../platform' ) ;
5
6
var ERROR = require ( '../error' ) ;
6
7
7
8
function StremioVideo ( ) {
@@ -25,6 +26,9 @@ function StremioVideo() {
25
26
action = deepFreeze ( cloneDeep ( action ) ) ;
26
27
options = options || { } ;
27
28
if ( action . type === 'command' && action . commandName === 'load' && action . commandArgs ) {
29
+ if ( action . commandArgs . platform ) {
30
+ platform . set ( action . commandArgs . platform ) ;
31
+ }
28
32
var Video = selectVideoImplementation ( action . commandArgs , options ) ;
29
33
if ( video !== null && video . constructor !== Video ) {
30
34
video . dispatch ( { type : 'command' , commandName : 'destroy' } ) ;
Original file line number Diff line number Diff line change @@ -633,9 +633,11 @@ function TizenVideo(options) {
633
633
634
634
var tizenVersion = false ;
635
635
636
- try {
637
- tizenVersion = parseFloat ( global . tizen . systeminfo . getCapability ( 'http://tizen.org/feature/platform.version' ) ) ;
638
- } catch ( e ) { }
636
+ var TIZEN_MATCHES = navigator . userAgent . match ( / T i z e n ( \d + \. \d + ) / i) ;
637
+
638
+ if ( TIZEN_MATCHES && TIZEN_MATCHES [ 1 ] ) {
639
+ tizenVersion = parseFloat ( TIZEN_MATCHES [ 1 ] ) ;
640
+ }
639
641
640
642
if ( ! tizenVersion || tizenVersion >= 6 ) {
641
643
retrieveExtendedTracks ( ) ;
Original file line number Diff line number Diff line change
1
+ var platform = null ;
2
+
3
+ module . exports = {
4
+ set : function ( val ) { platform = val ; } ,
5
+ get : function ( ) { return platform ; }
6
+ } ;
Original file line number Diff line number Diff line change
1
+ var platform = require ( './platform' ) ;
2
+
1
3
function supportsTranscoding ( ) {
2
- if ( typeof global . tizen !== 'undefined' || typeof global . webOS !== 'undefined' || typeof window . qt !== 'undefined' ) {
4
+ if ( [ 'Tizen' , ' webOS' ] . includes ( platform . get ( ) ) || typeof window . qt !== 'undefined' ) {
3
5
return Promise . resolve ( false ) ;
4
6
}
5
7
return Promise . resolve ( true ) ;
You can’t perform that action at this time.
0 commit comments