File

src/app/modules/shared/services/exturl-util/exturl-util.service.ts

Index

Properties
Methods

Constructor

constructor(configService: ConfigService)
Parameters :
Name Type Optional
configService ConfigService No

Methods

generateRedirectUrl
generateRedirectUrl(playerconfigMeta: any, userId?: string, courseId?: string, batchId?: string)

generateRedirectUrl function is to redirect to the external url link in a new tab

Parameters :
Name Type Optional Description
playerconfigMeta any No

Playerconfig data to get artifacturl and contentId of the item in the player

userId string Yes

user id of the loggedin user

courseId string Yes

course id of the enrolled / playing course

batchId string Yes
Returns : void

Properties

Public configService
Type : ConfigService
import { ConfigService } from './../config/config.service';
import { Injectable } from '@angular/core';

@Injectable()
export class ExternalUrlPreviewService {
    constructor(public configService: ConfigService) { }
    /**
      * generateRedirectUrl function is to redirect to the external url link in a new tab
      * @param playerconfigMeta Playerconfig data to get artifacturl and contentId of the item in the player
      * @param courseId course id of the enrolled / playing course
      * @param userId  user id of the loggedin user
      */
    generateRedirectUrl(playerconfigMeta: any, userId?: string, courseId?: string, batchId?: string) {
        setTimeout(() => {
            const newWindow = window.open('/learn/redirect', '_blank');
            newWindow.redirectUrl = playerconfigMeta.artifactUrl + (courseId !== undefined ? '#&courseId=' + courseId : '')
                + '#&contentId=' + playerconfigMeta.identifier + (batchId !== undefined ? '#&batchId=' + batchId : '') +
                (userId !== undefined ? '#&uid=' + userId : '');
        }, 1000);
    }
}

results matching ""

    No results matching ""