활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
Use case is as follows:
해결되었습니다! 솔루션으로 이동.
조회 수
답글
좋아요 수
Hi @MayuriK
You can use custom code option in VEC. Add custom javascript to append query parameters in the URL. you can use following JS code.
function insertParam(key, value) {
key = encodeURIComponent(key);
value = encodeURIComponent(value);
// kvp looks like ['key1=value1', 'key2=value2', ...]
var kvp = document.location.search.substr(1).split('&');
let i=0;
for(; i<kvp.length; i++){
if (kvp[i].startsWith(key + '=')) {
let pair = kvp[i].split('=');
pair[1] = value;
kvp[i] = pair.join('=');
break;
}
}
if(i >= kvp.length){
kvp[kvp.length] = [key,value].join('=');
}
// can return this or...
let params = kvp.join('&');
// reload page with new params
document.location.search = params;
}
query.append("test","true");
let me know if this works.
조회 수
답글
좋아요 수
Hi @MayuriK
You can use custom code option in VEC. Add custom javascript to append query parameters in the URL. you can use following JS code.
function insertParam(key, value) {
key = encodeURIComponent(key);
value = encodeURIComponent(value);
// kvp looks like ['key1=value1', 'key2=value2', ...]
var kvp = document.location.search.substr(1).split('&');
let i=0;
for(; i<kvp.length; i++){
if (kvp[i].startsWith(key + '=')) {
let pair = kvp[i].split('=');
pair[1] = value;
kvp[i] = pair.join('=');
break;
}
}
if(i >= kvp.length){
kvp[kvp.length] = [key,value].join('=');
}
// can return this or...
let params = kvp.join('&');
// reload page with new params
document.location.search = params;
}
query.append("test","true");
let me know if this works.
조회 수
답글
좋아요 수
Thanks for the information. But here we are creating form based activity and trying to create an html offer to add parameter to the URL.
How can we do that in case of form based activity.
Current implementation is as follows:
HTML offer code:
setTimeout(()=>{
let videoAutoPlay = document.querySelector('video-js');
videoAutoPlay.player.muted(true);
videoAutoPlay.player.play();
},1000);
I am not sure if this is the correct way.
조회 수
답글
좋아요 수
If you are still searching for alternatives it would also be possible to accomplish this via a redirect:
ExpA: Default
ExpB: Redirect from url1.com --to--> url1.com/?playnowparameter
The only caveat is you have to test to validate you aren't setting up an infinite redirect loop. If the activity is configured to allow access only from url1.com it should work however if it's configured to allow access from url that contains url1 it will result in an infinite redirect loop. Hope this helps.
--Docea
This method cannot be used as there is not one url where we need auto play functionality. There are multiple page URL
조회 수
답글
좋아요 수
Oh okay. I believe using code which I shared should resolve your problems.