Example #1
0
        private void prevVid_Click(object sender, RoutedEventArgs e)
        {
            var prevVid = new TikTokSimplifiedObject(getPrevTikTokObj());

            videoURL                       = prevVid.VideoUrl;
            authorImage.Source             = prevVid.AuthorImage;
            authorNameLabel.Text           = prevVid.AuthorName;
            videoDescriptionLabel.Document = prevVid.VideoDesc;
            likeNbrLabel.Content           = Utils.NormalizeNumber(prevVid.LikeNbr);
            commentNbrLabel.Content        = Utils.NormalizeNumber(prevVid.CommentNbr);
            shareNbrLabel.Content          = Utils.NormalizeNumber(prevVid.ShareNbr);
            Console.WriteLine(videoURL);
            _mp.Play(new Media(_libVLC, videoURL, FromType.FromLocation));
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            volumeTimer  = DateTime.Now;
            volumeThread = new Thread(volumeThreadFunc);
            volumeThread.Start();
            //TikTokLogin.XorEncrypt("password");
            /* Following part is made to get libVLC DLLs, as they are not copied in main folder*/
            var    currentAssembly  = Assembly.GetEntryAssembly();
            var    currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;
            string VlcLibDirectory  = new DirectoryInfo(System.IO.Path.Combine(currentDirectory, "libvlc", IntPtr.Size == 4 ? "win-x86" : "win-x64")).FullName;

            Core.Initialize(VlcLibDirectory);

            listOfTikTokObj = getNewTikTokObjList();
            AwemeStructV2          newVid = getNextTikTokObj();
            TikTokSimplifiedObject tikTokSimplifiedObject = new TikTokSimplifiedObject(newVid);

            videoURL           = tikTokSimplifiedObject.VideoUrl;
            authorImage.Source = tikTokSimplifiedObject.AuthorImage;
            Console.WriteLine(videoURL);

            _libVLC           = new LibVLC("--verbose=2");
            _mp               = new MediaPlayer(_libVLC);
            videoView.Loaded += (sender, e) => videoView.MediaPlayer = _mp;

            _mp.Volume         = 30;
            volumeSlider.Value = _mp.Volume;

            _mp.Play(new Media(_libVLC, "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", FromType.FromLocation));
            //_mp.Play(new Media(_libVLC, videoURL, FromType.FromLocation));

            _mp.TimeChanged   += TimeChanged;
            _mp.EndReached    += EndReached;
            _mp.VolumeChanged += VolumeChanged;

            PlayImage = new Image();
            var UriStringPlay            = @"pack://*****:*****@"pack://application:,,,/TikTokForWindows;component/Resources/pause-button.png";
            var UriBitmapImageSourcePause = new Uri(UriStringPause, UriKind.Absolute);

            PauseBitmapImage  = new BitmapImage(UriBitmapImageSourcePause);
            PauseImage.Source = PauseBitmapImage;

            LikeImage = new Image();
            var UriStringLike            = @"pack://*****:*****@"pack://application:,,,/TikTokForWindows;component/Resources/notlike-button.png";
            var UriBitmapImageSourceNotLike = new Uri(UriStringNotLike, UriKind.Absolute);

            NotlikeBitmapImage  = new BitmapImage(UriBitmapImageSourceNotLike);
            NotlikeImage.Source = NotlikeBitmapImage;
        }