Jump to content

Javascript issue


hackbart

Recommended Posts

Posted

Hi,

 

does somebody have any idea why the following code does not work:

 

c.prototype.setSource = function(a, c) {
            c = c || "video/mp4";
			
			this.stop();
            !d.PlayerBase.REBUILD_PLAYER && this.checkMediaElementIntegrity() || this.rebuildPlayer(c);
            var b = setInterval(function(d) {
                d._mediaElement && (d._mediaElement.type = c, d._mediaElement.data = a, 
                d.playState = e.states.INIT, 
                d._mediaElement.onPlayStateChange = function() {
                    var a = d.getPlayState();
                    d.playState !== a && (d.playStateChange(a), d.playState = a)
                }, d.vidSource = a, clearInterval(b))
            }, 100, this)
        };
        

but:

 

c.prototype.setSource = function(a, c) {
            c = c || "video/mp4";
			
			this.stop();
            !d.PlayerBase.REBUILD_PLAYER && this.checkMediaElementIntegrity() || this.rebuildPlayer(c);
            var b = setInterval(function(d) {
                d._mediaElement && (d._mediaElement.type = c, d._mediaElement.data = a, 
                d.playState = e.states.INIT, alert("Hello"), 
                d._mediaElement.onPlayStateChange = function() {
                    var a = d.getPlayState();
                    d.playState !== a && (d.playStateChange(a), d.playState = a)
                }, d.vidSource = a, clearInterval(b))
            }, 100, this)
        };
        

does? I mean the only difference is alert("Hello"). 

The code is part of the Watchbox HbbTV application which is the successor of clip fish. Does alert does something special, except raising a message box?

 

Christian

Posted

I'm loving it, while debugging their HbbTV application - they somehow managed to add yet another bug into it :disgust:

 

/js/app.2063364764.min.js:8723 Uncaught TypeError: Cannot read property 'ivw_tag_t1' of undefined

 

Posted

Okay, they fixed the problem, so i was able to fiddle out why the playback inside the DVBViewer was not working.

I'm not sure if it is a bug of their script, a problem of Webkit - which we use for rendering, or an issue inside the HbbTV implementation. Anyhow it seem to be that i have to focus the video object in order to get onPlayStateChange working. 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...