File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1414 < div id ="title-container ">
1515 < h1 > Diffusion Studio Examples</ h1 >
1616 < select name ="scripts ">
17+ < option value ="font "> Custom Font</ option >
1718 < option value ="filters "> Filters</ option >
1819 < option value ="captions "> Captions</ option >
1920 < option value ="drag-and-drop "> Drag and Drop</ option >
2021 < option value ="custom-captions "> Custiom Captions</ option >
21- < option value ="font "> Custom Font</ option >
2222 < option value ="split-video "> Split Video</ option >
2323 < option value ="video-trimming "> Video Trimming</ option >
2424 < option value ="reddit-stories "> Reddit Stories</ option >
Original file line number Diff line number Diff line change @@ -12,3 +12,5 @@ if (!isSupported) {
1212 const el = document . querySelector ( '[id="browser-not-supported"]' ) as HTMLParagraphElement ;
1313 el . style . display = 'block' ;
1414}
15+
16+ export const isMobile = / A n d r o i d | w e b O S | i P h o n e | i P a d | i P o d | B l a c k B e r r y | I E M o b i l e | O p e r a M i n i / i. test ( navigator . userAgent ) ;
Original file line number Diff line number Diff line change 11import * as core from '@diffusionstudio/core' ;
22import { MainFn , Settings } from './types' ;
3- import './borwser-support' ;
3+ import { isMobile } from './borwser-support' ;
44
55const select = document . querySelector ( 'select' ) as HTMLSelectElement ;
66const container = document . querySelector ( '[id="player-container"]' ) as HTMLDivElement ;
@@ -19,7 +19,10 @@ async function loadScript(name: string) {
1919 const module = await import ( `./${ name } .ts` ) ;
2020 const main : MainFn = module . main ;
2121 const settings : Settings = module . settings ;
22- const composition = new core . Composition ( settings ) ;
22+ const composition = new core . Composition ( {
23+ ...settings , // force webgl on mobile
24+ backend : isMobile ? 'webgl' : undefined
25+ } ) ;
2326 await main ( composition ) ;
2427
2528 const handlePlay = ( ) => composition . play ( ) ;
@@ -66,7 +69,7 @@ async function loadScript(name: string) {
6669
6770 return ( ) => {
6871 composition . pause ( ) ;
69-
72+
7073 playButton . removeEventListener ( 'click' , handlePlay ) ;
7174 pauseButton . removeEventListener ( 'click' , handlePause ) ;
7275 backButton . removeEventListener ( 'click' , handleBack ) ;
You can’t perform that action at this time.
0 commit comments