Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Youtube with vimeo with mp4 local files #23

Open
bm2ilabs opened this issue Jul 22, 2015 · 0 comments
Open

Youtube with vimeo with mp4 local files #23

bm2ilabs opened this issue Jul 22, 2015 · 0 comments

Comments

@bm2ilabs
Copy link

Hello, first of all , i really like the plugin it work perfectly with only mp4 files so far , i try to include youtube and vimeo in the playlist but i still couldn't figure out

<a class='clearfix vjs-track' href='#episode-$i"  data-index='{{ index}}' data-src='{{ src }}' data-type="{{ type }} ">
  • data-index : has an auto-increment
  • data-type : video/mp4 or video/youtube or video/vimeo this is dynamic as well , so i replace this
if (player.techName == 'youtube') {
                player.src([
                    {type: type = "video/youtube", src: src}
                ]);
            } else if (player.techName == 'vimeo') {
                player.src([
                    {type: type = "video/vimeo", src: src}
                ]);
            } else if (player.techName == 'soundcloud') {
                player.src([
                    {type: type = "audio/soundcloud", src: src}
                ]);
            }
            else {

                if (player.el().firstChild.tagName == "AUDIO" || (typeof options.mediaType != 'undefined' && options.mediaType == "audio")) {

                    player.src([
                        {type: "audio/mp4", src: src},
                        {type: "audio/webm", src: src},
                        {type: type = "video/youtube", src: src},
                        {type: type = "video/vimeo", src: src},
                        {type: type = "audio/soundcloud", src: src},
                        {type: "audio/ogg", src: src}
                        /*{ type: "audio/mpeg", src:  src+".mp3" },
                         { type: "audio/ogg", src: src+".oga" }*/
                    ]);
                }
                else {
                    //console.log("video");
                    player.src([
                        {type: "video/mp4", src: src},
                        {type: type = "video/youtube", src: src},
                        {type: "video/webm", src: src}
                        //{ type: "video/ogv", src: src+".ogv" }
                    ]);
                }
            }

with this

player.src([
                {type: type , src: src}
            ]);                                                            

and added

            var type = track.getAttribute('data-type');

but still getting the issue of "No compatible source was found for this video."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant