src/widgets/Mediafragment.js
branchnew-model
changeset 906 4b6e154ae8de
parent 905 029a4efe9e24
child 910 b9f1bd52df9a
equal deleted inserted replaced
905:029a4efe9e24 906:4b6e154ae8de
     3     this.last_hash_key = "";
     3     this.last_hash_key = "";
     4     this.last_hash_value = "";
     4     this.last_hash_value = "";
     5     window.onhashchange = this.functionWrapper("goToHash");
     5     window.onhashchange = this.functionWrapper("goToHash");
     6     if (typeof window.addEventListener !== "undefined") {
     6     if (typeof window.addEventListener !== "undefined") {
     7         window.addEventListener('message', function(_msg) {
     7         window.addEventListener('message', function(_msg) {
     8             if (_msg.data.type === "hashchange") {
     8             if (/^#/.test(_msg.data)) {
     9                 document.location.hash = _msg.data.hash;
     9                 document.location.hash = _msg.data;
    10             }
    10             }
    11         })
    11         })
    12     };
    12     };
    13     this.bindPopcorn("pause","setHashToTime");
    13     this.bindPopcorn("pause","setHashToTime");
    14     this.bindPopcorn("seeked","setHashToTime");
    14     this.bindPopcorn("seeked","setHashToTime");
    71         this.last_hash_key = _key;
    71         this.last_hash_key = _key;
    72         this.last_hash_value = _value;
    72         this.last_hash_value = _value;
    73         var _hash = this.getLastHash();
    73         var _hash = this.getLastHash();
    74         document.location.hash = _hash;
    74         document.location.hash = _hash;
    75         if (window.parent !== window) {
    75         if (window.parent !== window) {
    76             window.parent.postMessage({
    76             window.parent.postMessage(_hash,"*")
    77                 type: "hashchange",
       
    78                 hash: _hash
       
    79             })
       
    80         }
    77         }
    81         this.block();
    78         this.block();
    82     }
    79     }
    83 }
    80 }
    84 
    81