Comments (8)
No worries! The problem we have here is that PBS doesn't provide any way for us to access a user's preferences -- aka watchlist, or where they left off on a particular video. They do have this available for their internal uses as part of PBS Account, but haven't made it available to 'external' developers.
From my conversations with them I think this is on their roadmap. Specifically they're working on an evolution of PBS Account that will also work with NPR's auth setup, and that's supposed to include 'portable' preference setting. That's going to be at least a year, though.
If you don't need to have cross-platform access to the view status, you could try an approach that doesn't even require logging in; get the position of the video from JW Player (the basis of the Partner Player) when a person exits, store that in a cookie, and check for the cookie when a person starts up again. I have some javascript I can dig up that checks the status of the Partner Player video iframe that you could possibly use as a starting point.
from pbs-passport-authenticate.
Thanks for the reply, really appreciate it. I kinda came to the same conclusion, but thought I would check to see if I was missing anything -- so now I feel much better :)
But yes, if you have that javascript, I certainly could use it. To be honest, trying to read 'status' from the embedded iframe jwplayer video has been tricky to say the least.
And again, thanks for the reply.
from pbs-passport-authenticate.
I use it to do event tracking. See this blog post, you can ignore all the bits about getting Google Tag Manager working. https://ieg.wnet.org/2015/07/using-google-tag-manager-for-custom-event-tracking/
from pbs-passport-authenticate.
Awesome, thank you very much! I owe you one!
Chet
from pbs-passport-authenticate.
that code's a few years old and there's been some updates because PBS has changed some things.
<script>
if(typeof window.addEventListener==='function'){
window.addEventListener("message",receiveCOVEVideoMessage,false);
}else{
window.attachEvent("onmessage",receiveCOVEVideoMessage);
}
var COVEVideoTitle;
var COVELastAction;
function receiveCOVEVideoMessage(evt){
if(typeof window["dataLayer"]==='undefined'){
dataLayer = [];
}
if ( evt.origin == 'http://player.pbs.org' || evt.origin == 'https://player.pbs.org' ) {
var thissourcewindow = evt.source;
var data=evt.data,
action=evt.data.split('::')[0],
value=evt.data.split('::')[1];
if (action==="video") {
if (value==="playing" && COVELastAction !=="seeking") {
dataLayer.push({
event: 'COVEEvent',
'COVEaction':'MediaStart',
'videoTitle': COVEVideoTitle
});
COVELastAction=value;
} else if (value==="seeking") {
COVELastAction=value;
} else if (value==="finished" && COVELastAction !=="finished") {
dataLayer.push({
event: 'COVEEvent',
'COVEaction':'MediaFinish',
'videoTitle': COVEVideoTitle
});
COVELastAction=value;
}
} else if (action==="videoInfo") {
videoInfo = JSON.parse(value);
COVEVideoTitle = videoInfo.title;
if (typeof videoInfo.program.title !== 'undefined') {
COVEVideoTitle = videoInfo.program.title + ": " + COVEVideoTitle;
}
}
}
}
</script>
from pbs-passport-authenticate.
Thanks, any idea what the variable for the ID or slug of the video being viewed would be?
COVEVideoID
or similar? Is there a doc out there that lists the variables/actions?
from pbs-passport-authenticate.
not offhand. If you dump the entire output of 'data' to console instead of what I've filtered it down to, I think it'll be there. Probably along with the position in the video.
from pbs-passport-authenticate.
Will do, thanks again for your help!
from pbs-passport-authenticate.
Related Issues (10)
- possible redirect loop in odd login state case HOT 1
- No example code for embedding a passport video HOT 1
- No example CSS HOT 1
- logout method sometimes leaves userinfo cookie behind
- jQuery error on page load HOT 7
- Activation code lookup should be configurable HOT 2
- Undefined vars preventing passport video HOT 3
- Encrypt method issue HOT 1
- encrypt_method should be selectable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pbs-passport-authenticate.