@@ -311,25 +311,19 @@ export class TransmuteNativeDocument extends EventTarget implements NativeDocume
311311 return Promise . resolve ( imageData as any ) ;
312312 }
313313
314- async ready ( spatialDocument : SpatialDocumentImpl ) {
315- const metadata : DocumentMetadata = {
316- specVersion : spatialDocument . querySelector ( 'xsml' ) ?. getAttribute ( 'version' ) ,
317- } ;
318- const descriptionMeta = spatialDocument . querySelector ( 'meta[name="description"]' ) ;
319- if ( descriptionMeta ) {
320- metadata . description = descriptionMeta . getAttribute ( 'content' ) ;
321- }
322- const authorMeta = spatialDocument . querySelector ( 'meta[name="author"]' ) ;
323- if ( authorMeta ) {
324- metadata . author = authorMeta . getAttribute ( 'content' ) ;
325- }
326- const licenseMeta = spatialDocument . querySelector ( 'meta[name="license"]' ) ;
327- if ( licenseMeta ) {
328- metadata . license = licenseMeta . getAttribute ( 'content' ) ;
329- }
314+ async ready ( dom : JSARDOM < TransmuteNativeDocument > ) {
315+ const metadata = await dom . createDocumentManifest ( ) ;
330316 await this . engine . onReady ( this . _scene , {
331- title : spatialDocument . title ,
332- metadata,
317+ title : metadata . title ,
318+ metadata : {
319+ specVersion : metadata . specVersion ,
320+ description : metadata . description ,
321+ author : metadata . author ,
322+ keywords : metadata . keywords ,
323+ license : metadata . license ,
324+ licenseUrl : metadata . licenseUrl ,
325+ viewportInitialScale : metadata . viewport ?. initialScale ,
326+ } ,
333327 } ) ;
334328 }
335329}
0 commit comments