ask about code run on fire fox and not run on chrome the same code for video player with event timer can any one help me

aya ahmed 93
Posts: 11
Joined: Wed Sep 06, 2017 10:20 am

ask about code run on fire fox and not run on chrome the same code for video player with event timer can any one help me

Postby aya ahmed 93 » Wed Sep 06, 2017 12:50 pm

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}

#container {
height: 100%;
width: 50%;
display: inline-block;
}
</style>

</head>
<body>

<div id="container"></div>


<script src="lib/three.js/three.custom.min.js"></script>
<!-- Include the Hammer.js library -->
<script src="lib/hammer.js/hammer.js"></script>
<!-- Include the ForgeJS library -->
<script src="lib/forge/forge.js"></script>

<script>

// Create a viewer



function StartPlayVideo() {

var config = {
"story":
{
"uid": "story-0",
"name": "Video Controls",
"slug": "video-controls",
"description": "This is a project sample with video controls plugin",
"default": "scene-0",

"scenes":
[
{
"uid": "scene-0",
"name": "First scene",
"slug": "first-scene",
"description": "This is the first scene",

"media":
{
"uid": "video-0",
"type": "video",

"source":
{
"format": "equi",
"url": "Route1.mp4",


},

"options":
{
"autoPlay": false,
"loop": true,
"volume": 0.5
}
},

"view":
{
"type": "GoPro"
},

"plugins":
{
"instances":
[
{
"uid": "org.forgejs.videocontrols-0",
"engine": "org.forgejs.videocontrols",


"data": {},
"keep": false,
"index": 1
}
]
}
}
]
},
"events": {
"onStart ": ['hi'

]
},
"plugins":
{
"enabled": true,
"prefix": "/plugins/",

"engines":
[
{
"uid": "org.forgejs.videocontrols",
"url": "VideoControls/"
}
]
}
}


var viewer = new FORGE.Viewer("container", config);
function onReadyHandler() {
viewer.story.onSceneLoadComplete.add(onSceneLoadCompleteHandler);
}

function onSceneLoadCompleteHandler() {
var media = viewer.story.scene.media;

if (media.type === FORGE.MediaType.VIDEO) {
var video = media.displayObject;
video.onTimeUpdate.add(onTimeUpdateHandler);

}
}

function onTimeUpdateHandler(data) {
// console.log(data.emitter.remainingTime)
console.log(data.emitter.currentTime)
//viewer.story.nextScene();
}

viewer.onReady.addOnce(onReadyHandler);
}

StartPlayVideo();


</script>
</body>
</html>
aaa

aya ahmed 93
Posts: 11
Joined: Wed Sep 06, 2017 10:20 am

Re: ask about code run on fire fox and not run on chrome the same code for video player with event timer can any one hel

Postby aya ahmed 93 » Wed Sep 06, 2017 12:52 pm

its local video and i test with another published video and have same problem when i remove code belong to events it run on chrome but with code of event not run
aaa

User avatar
bbaudel
ForgeJS Team
Posts: 45
Joined: Wed Oct 26, 2016 9:20 am

Re: ask about code run on fire fox and not run on chrome the same code for video player with event timer can any one hel

Postby bbaudel » Wed Sep 06, 2017 2:40 pm

I've run your sample with current develop version of the library and it works on Chrome Windows. I can see the console.log linked to the time updates.
Are you under macOS ?

aya ahmed 93
Posts: 11
Joined: Wed Sep 06, 2017 10:20 am

Re: ask about code run on fire fox and not run on chrome the same code for video player with event timer can any one hel

Postby aya ahmed 93 » Wed Sep 06, 2017 3:11 pm

no iam on windows 10 not mac i download plugin version from github may it the problem ? because i use another pc and have same problem
aaa

aya ahmed 93
Posts: 11
Joined: Wed Sep 06, 2017 10:20 am

Re: ask about code run on fire fox and not run on chrome the same code for video player with event timer can any one hel

Postby aya ahmed 93 » Thu Sep 07, 2017 7:39 am

forge.js:2303 Uncaught UID configuration not valid, uid story-0 already have an object binded to! this error in console
aaa

aya ahmed 93
Posts: 11
Joined: Wed Sep 06, 2017 10:20 am

Re: ask about code run on fire fox and not run on chrome the same code for video player with event timer can any one hel

Postby aya ahmed 93 » Thu Sep 07, 2017 7:43 am

[img]
Capture.PNG
[/img]
Attachments
Capture.PNG
this error please advise me thanks in advance for support :)
Capture.PNG (23.26 KiB) Viewed 19939 times
aaa

User avatar
rroux
ForgeJS Team
Posts: 166
Joined: Wed Oct 26, 2016 12:19 pm

Re: ask about code run on fire fox and not run on chrome the same code for video player with event timer can any one hel

Postby rroux » Thu Sep 07, 2017 8:39 am

It sounds like you have a duplicate uid in your configuration.
Please check how many times you have "story-0" as uid in the configuration.
All uid have to be unique!
- Raphaël

User avatar
bbaudel
ForgeJS Team
Posts: 45
Joined: Wed Oct 26, 2016 9:20 am

Re: ask about code run on fire fox and not run on chrome the same code for video player with event timer can any one hel

Postby bbaudel » Thu Sep 07, 2017 8:49 am

No issue on my side with your code above.

It seems that there is a double or more instantiation of the same viewer and so the "story-0" UID is already present in your case.
Have you change something to your code sample above ?

On each THREE.WebGLRenderer 86 into the console the viewer is instantiated for information.

aya ahmed 93
Posts: 11
Joined: Wed Sep 06, 2017 10:20 am

Re: ask about code run on fire fox and not run on chrome the same code for video player with event timer can any one hel

Postby aya ahmed 93 » Thu Sep 07, 2017 10:14 am

yes this error because i change call function and put it inside for loop thanks in advance for Ur support :)
aaa

User avatar
bbaudel
ForgeJS Team
Posts: 45
Joined: Wed Oct 26, 2016 9:20 am

Re: ask about code run on fire fox and not run on chrome the same code for video player with event timer can any one hel

Postby bbaudel » Fri Sep 08, 2017 12:42 pm

So is it possible to send me the code used into it's latest version to see if I can change something, because on my side i've no issue with your code above?

Who is online

Users browsing this forum: No registered users and 1 guest