Sub

更新时间:
复制 MD 格式

This topic describes the APIs for the presentation Sub object.

Sub.SlideShowBegin

Listens for the event triggered when a slide show enters full screen.

  • Syntax

    expression.Sub.SlideShowBegin = Function

    Expression: document type, application, object

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Listen for entering full screen.
      app.Sub.SlideShowBegin = async () => {
        console.log('Enter');
      };
    
      setTimeout(async () => {
        // Switch to the full screen slide show state.
        await app.ActivePresentation.SlideShowSettings.Run();
      }, 2000);
    }

Sub.SlideSelectionChanged

Listens for the event triggered when the current page changes.

  • Syntax

    expression.Sub.SlideSelectionChanged = eventHandle

    Expression: The application object for the presentation document.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen for the current page change event.
      app.Sub.SlideSelectionChanged = async (curryPage) => {
        console.log('Switched to: ', curryPage);
      };
    }

Sub.SlideShowEnd

Listens for the event triggered when a slide show exits full screen.

  • Syntax

    expression.Sub.SlideShowEnd = Function

    Expression: Application object for the document type

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Switch to the full screen slide show state.
      await app.ActivePresentation.SlideShowSettings.Run();
    
      // Listen for the event of exiting full screen.
      app.Sub.SlideShowEnd = async () => {
        console.log('Exit');
      };
    
      // Exit full screen.
      setTimeout(async () => {
        await app.ActivePresentation.SlideShowWindow.View.Exit();
      }, 2000);
    }

Sub.SlideShowOnNext

Listens for the event triggered by the next animation operation.

  • Syntax

    expression.Sub.SlideShowOnNext = Function

    Expression: Application object of the document type

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Switch to the full screen slide show state.
      await app.ActivePresentation.SlideShowSettings.Run();
    
      // Listen for the next animation operation.
      app.Sub.SlideShowOnNext = async () => {
        console.log('Next');
      };
    
      // Execute the next operation after 3 seconds.
      setTimeout(async () => {
        await app.ActivePresentation.SlideShowWindow.View.GotoNextClick();
      }, 3000);
    }

Sub.SlideShowOnPrevious

Listens for the event triggered by the previous animation operation.

  • Syntax

    expression.Sub.SlideShowOnPrevious = Function

    Expression: Application object (document type)

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Switch to the full screen slide show state.
      await app.ActivePresentation.SlideShowSettings.Run();
    
      // Listen for the previous animation operation.
      app.Sub.SlideShowOnPrevious = async () => {
        console.log('Previous');
      };
    
      // Execute the next step after 3 seconds.
      setTimeout(async () => {
        await app.ActivePresentation.SlideShowWindow.View.GotoNextClick();
      }, 3000);
    
      // Execute the previous step after 5 seconds.
      setTimeout(async () => {
        await app.ActivePresentation.SlideShowWindow.View.GotoPreClick();
      }, 5000);
    }

Sub.ActiveSlideChange

Listens for the event triggered by page navigation.

  • Syntax

    expression.Sub.ActiveSlideChange = eventHandle

    Expression: The application object for the presentation document.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen for the page navigation event.
      app.Sub.ActiveSlideChange = async (curryPage) => {
        console.log('Switched to: ', curryPage);
      };
    }

Sub.VideoFullscreenInfo

Listens for the event triggered when a demo video enters or exits full screen.

Important

This feature is available in JS-SDK 1.1.14 and later.

This feature is supported only on PCs.

  • Syntax

    expression.Sub.VideoFullscreenInfo = eventHandle

    Expression: application object of a document type

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen for the event when a demo video enters or exits full screen.
      app.Sub.VideoFullscreenInfo = async () => {
        console.log('Full screen state changed.');
      };
    }

Sub.TriggerPlayEvent

Important

This feature is available in JS-SDK 1.1.9 and later.

Listens for the event triggered when a trigger animation plays.

  • Syntax

    expression.Sub.TriggerPlayEvent = eventHandle

    Expression: application object of a document type

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen for the trigger animation event.
      app.Sub.TriggerPlayEvent = (curryPage) => {
        console.log('Trigger animation: ', curryPage);
      };
    }

Sub.SlideMove

Listens for the event triggered when a slide is moved.

Important

This feature is available in JS-SDK 1.1.10 and later.

  • Syntax

    expression.Sub.SlideMove = eventHandle

    Expression: The application object for the presentation document.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen for slide moves.
      app.Sub.SlideMove = (d) => {
        console.log('Listening for slide move: ', d);
      };
    }

Sub.PresentationNewSlide

Listens for the event triggered when a new slide is created.

Important

This feature is available in JS-SDK 1.1.10 and later.

  • Syntax

    expression.Sub.PresentationNewSlide = eventHandle

    Expression: Document-Type Application Object

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen for slide moves.
      app.Sub.SlideMove = (d) => {
        console.log('Listening for slide move: ', d);
      };
    }

Sub.SlideDelete

Listens for the event triggered when a slide is deleted.

Important

This feature is available in JS-SDK 1.1.10 and later.

  • Syntax

    expression.Sub.SlideDelete = eventHandle

    Expression: The application object for the presentation document.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen for the slide deletion event.
      app.Sub.SlideDelete = (d) => {
        console.log('Listening for slide deletion: ', d);
      };
    }

Sub.SlidePlayerChange

Listens for the event triggered when the playback state changes.

Important

This feature is available in JS-SDK 1.1.10 and later.

  • Syntax

    expression.Sub.SlidePlayerChange = eventHandle

    Expression: The application object for the presentation document.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen for the playback state change event.
      app.Sub.SlidePlayerChange = ({Data}) => {
        console.log('Listening for playback state change: ', Data);
      };
    }

Sub.SlideMediaChanged

Listens for the event triggered when the video playback state changes.

Important

This feature is available in JS-SDK 1.1.10 and later.

  • Syntax

    expression.Sub.SlideMediaChanged = eventHandle

    Expression: Document Type's Application Object

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen for the video playback state change event.
      app.Sub.SlideMediaChanged = ({Data}) => {
        console.log('Listening for video playback state change: ', Data);
      };
    }

Sub.SlideLaserPenInkPointsChanged

Listens for the event triggered when the laser pen ink points change.

Important
  • This feature is available in JS-SDK 1.1.10 and later.

  • This feature is supported only on PCs.

  • Syntax

    expression.Sub.SlideLaserPenInkPointsChanged = eventHandle

    Expression: The application object for the presentation document.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen for the laser pen ink event.
      app.Sub.SlideLaserPenInkPointsChanged = ({Data}) => {
        console.log('Listening for laser pen ink: ', Data);
      };
    }

Sub.SlideInkVisible

Listens for the event triggered when annotations are shown or hidden.

Important
  • This feature is available in JS-SDK 1.1.10 and later.

  • This feature is supported only on PCs.

  • Syntax

    expression.Sub.SlideInkVisible = eventHandle

    Expression: Application object for document type

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Window object
      const SlideShowWindow = await app.ActivePresentation.SlideShowWindow;
    
      // View object
      const view = await SlideShowWindow.View
      
      // Listen for whether to show annotations.
      app.Sub.SlideInkVisible = ({Data}) => {
        console.log('Listening for whether to show annotations: ', Data);
    
        if(Data.showmark){
          setTimeout(() => {
            view.PointerVisible = false;
          }, 2000)
          
        }
      };
    }

Sub.SlideInkToolbarVisible

You can listen for laser pointer and annotation events.

Important
  • This feature is available in JS-SDK 1.1.10 and later.

  • This feature is supported only on PCs.

  • Syntax

    expression.Sub.SlideInkToolbarVisible = eventHandle

    Expression for a Document Type Application Object

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Window object
      const SlideShowWindow = await app.ActivePresentation.SlideShowWindow;
    
      // View object
      const view = await SlideShowWindow.View
      
      // Listen for whether to use the laser pen and annotations.
      app.Sub.SlideInkToolbarVisible = ({Data}) => {
        console.log('Listening for whether to use the laser pen and annotations: ', Data);
    
      };
    
      // Show the annotation toolbar.
      view.MarkerEditVisible = true;
    }

Sub.SlideChangeOperator

Listens for a server-side event that notifies the current operator after a slide is added, moved, or deleted.

Important

This feature is available in JS-SDK 1.1.11 and later.

  • Syntax

    expression.Sub.SlideChangeOperator = eventHandle

    Expression: document-type application object

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Listen for the server-side notification event sent to the current operator after a slide is added, moved, or deleted.
      app.Sub.SlideChangeOperator = (Date) => {
        console.log('Listening for the server-side notification to the current operator after a slide is updated (triggered by adding, moving, or deleting a slide): ', Data);
      };
    }

Sub.LastSlideEnd

Listens for the event triggered when the last slide of a slide show ends.

Important

This feature is available in JS-SDK 1.1.14 and later.

  • Syntax

    expression.Sub.LastSlideEnd = eventHandle

    Expression: Application object for the document type

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Listen for the notification event when the slide show ends.
      app.Sub.LastSlideEnd = (data) => {
        console.log('Notification for the end of the slide show:', data);
      };
    }